Need help with libraries for C programs. (solved)

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
BobDownUnder
Level 1
Level 1
Posts: 5
Joined: Tue Dec 12, 2017 11:53 pm

Need help with libraries for C programs. (solved)

Post by BobDownUnder » Sun Dec 17, 2017 9:59 pm

Hope I'm in the right forum for this one.
I haven't played with Linux , or C since about 1999, and even then I was a rank amateur programmer, but I have now made the switch fully from that other OS.

I found source code for an old tetris game, but when I tried to compile it I got an error saying "graphics .h" doesn't exist.
A quick search told me that graphics.h hasn't been used for a couple of decades.
I'm not sure which of the other .h files would also be obsolete.

Could someone point me in the direction of the best replacement packages to get, and tell me what my new include lines would be with the new packages. I've already got build essentials for the stdio.h file, but don't know how to find a list of the other files in that package.
The old lines are;
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
#include <conio.h>

Thanks
Last edited by BobDownUnder on Mon Dec 18, 2017 6:00 pm, edited 1 time in total.

User avatar
Flemur
Level 16
Level 16
Posts: 6109
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Need help with libraries for C programs.

Post by Flemur » Sun Dec 17, 2017 10:53 pm

#include <stdlib.h>
#include <stdio.h>
and some others, are in

Code: Select all

sudo apt-get install build-essential 
graphics.h - ??
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

User avatar
thx-1138
Level 6
Level 6
Posts: 1152
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Need help with libraries for C programs.

Post by thx-1138 » Mon Dec 18, 2017 9:32 am

#include <dos.h>
#include <conio.h>
Wow! :-)
Not a C programmer myself, but you might want to look at:
http://libxbgi.sourceforge.net/#howto
I wouldn't be surprised if quite a few parts would have to be re-written though...

rene
Level 8
Level 8
Posts: 2172
Joined: Sun Mar 27, 2016 6:58 pm

Re: Need help with libraries for C programs.

Post by rene » Mon Dec 18, 2017 9:36 am

graphics.h is from the DOS era. Specifically, likely refers to the Borland Graphics Interface (BGI) and means the program was expected to be compiled with Turbo/Borland C. Seems that someone has, of course, implemented BGI on top of SDL on Linux:

https://github.com/Prashant47/libgraph

but essentially the comment should be that if anything, you should be porting that program to Linux, not expecting to be able to just recompile; dos.h and conio.h will also link it rigidly to DOS.

BobDownUnder
Level 1
Level 1
Posts: 5
Joined: Tue Dec 12, 2017 11:53 pm

Re: Need help with libraries for C programs. (solved)

Post by BobDownUnder » Mon Dec 18, 2017 5:59 pm

Turbo/borland c is what I played with back in the old days too.
I guess I'll ditch that program and move on into the modern era.
Thanks guys.

Post Reply

Return to “Software & Applications”