Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tomflaherty2

macrumors newbie
Original poster
Jan 31, 2012
7
0
Hey guys,

I've just started using xcode to write some c programs, and the #include <stdio.h> header works fine, but when I try to include the graphics library, it produces an error on the line:

#include <graphics_lib.h> (!) 'graphics_lib.h' file not found

Does anyone know how to solve this?

Thanks.
 

tomflaherty2

macrumors newbie
Original poster
Jan 31, 2012
7
0
Sorry for replying to my own thread, but I'm now also getting this error for conio.h.

Thanks.
 

KnightWRX

macrumors Pentium
Jan 28, 2009
15,046
4
Quebec, Canada
Do you have these headers installed and in the include path (-I/path/to/headers) in your project settings ?

I really doubt you'll find conio.h though, since that's an old DOS thing that mostly is part of Borland's runtime library.

graphics_lib.h seems to be a part of Doxygen, do you have that installed ?
 

tomflaherty2

macrumors newbie
Original poster
Jan 31, 2012
7
0
Do you have these headers installed and in the include path (-I/path/to/headers) in your project settings ?

I really doubt you'll find conio.h though, since that's an old DOS thing that mostly is part of Borland's runtime library.

graphics_lib.h seems to be a part of Doxygen, do you have that installed ?

I'm not sure what you mean by having them installed in the path (what does -I/path/to/headers refer to?) but I doubt that they are installed.

Also what is Doxygen? No I don't have it, and I've been having a look online and I don't really understand what it is and what it does.

Assuming this Doxygen will fix this problem, how do I get/install it?

EDIT: I've just downloaded and run Doxygen....... *confused* I don't really get this program - how do I make it so xcode works?

Thanks.
 

ScoobyMcDoo

macrumors 65816
Nov 26, 2007
1,188
37
Austin, TX
Like KnightWRX said, conio.h is dos specific. I replied to another thread yesterday from someone trying to use it and pointed out a different solution to do what he wanted (are ya'll in the same class).

I have not idea what package graphics_lib.h belong to. I did a quick google search for it and found one that is included with BOINC, but I don't think that's what you are looking for.

I'm assuming this is for a class assignment - is that correct? If so was this graphics_lib.h supplied by your prof?
 

tomflaherty2

macrumors newbie
Original poster
Jan 31, 2012
7
0
Like KnightWRX said, conio.h is dos specific. I replied to another thread yesterday from someone trying to use it and pointed out a different solution to do what he wanted (are ya'll in the same class).

I have not idea what package graphics_lib.h belong to. I did a quick google search for it and found one that is included with BOINC, but I don't think that's what you are looking for.

I'm assuming this is for a class assignment - is that correct? If so was this graphics_lib.h supplied by your prof?

Yeah this is all for class work. I don't think it was supplied, no, but in the labs we're using Windows machines with Visual C++ on it, and so I guess the department has supplied all the necessary packages. I will send an e-mail to my prof., but since I'm on a mac, I'm not sure how much help he'll be.

Can you point me towards the thread you replied to, so I can have a look at the different solution?

Thanks.

EDIT: My teacher has supplied me with copies of the .h & .cpp files, so now all I need to do is know where to put them so they can be called from xcode anytime. Again, can someone help?
 

KnightWRX

macrumors Pentium
Jan 28, 2009
15,046
4
Quebec, Canada
EDIT: My teacher has supplied me with copies of the .h & .cpp files, so now all I need to do is know where to put them so they can be called from xcode anytime. Again, can someone help?

Just add them to your project. Remember to then include them using this syntax :

Code:
#include "graphics_lib.h"

Doxygen was a hit when I searched for that header, not knowing what package it was a part of.

If you want conio.h's equivalent on Unix, it is the curses library. It's not quite the same though, as contrary to conio, you can't mix stdio functions with curse functions.

I'm not quite sure if your Prof is making you use this stuff that it's going to work properly on Mac. That's the pitfall of not using industry standards to teach, but rather using Microsoft exclusive technologies/libraries.
 

tomflaherty2

macrumors newbie
Original poster
Jan 31, 2012
7
0
Just add them to your project. Remember to then include them using this syntax :

Code:
#include "graphics_lib.h"

Do I have to add it to every different project when I want to call it? Can't I just add it to a standard xcode directory which contains all these files?
 

tomflaherty2

macrumors newbie
Original poster
Jan 31, 2012
7
0
Okay guys thanks for all your help.

However, as soon as I add one new .h file to the project (such as graphics_lib.h) then defined in this header file, is an include to another .h file (such as conio.h) and in that one there's an include to another .h file (windows.h) and so on and so forth.

Is there not just a standard pack containing all these files which I can load up to say, a templates folder, or a such-like thing where xcode knows to pull them from when it gets an include?

Thanks.
 

KnightWRX

macrumors Pentium
Jan 28, 2009
15,046
4
Quebec, Canada
Okay guys thanks for all your help.

However, as soon as I add one new .h file to the project (such as graphics_lib.h) then defined in this header file, is an include to another .h file (such as conio.h) and in that one there's an include to another .h file (windows.h) and so on and so forth.

Of course, these files are rarely just a single file, but always part of a bigger library of standard functions.

Is there not just a standard pack containing all these files which I can load up to say, a templates folder, or a such-like thing where xcode knows to pull them from when it gets an include?

Since these are part of the Microsoft runtime, no. Not unless you're on a Windows platform using either Microsoft's Visual C++ product or an equivalent like Mingw.

If your professor insists on using these proprietary libraries for his assignments, you'll have no choice but to use a Microsoft platform to write your assignments on.
 

tomflaherty2

macrumors newbie
Original poster
Jan 31, 2012
7
0
Since these are part of the Microsoft runtime, no. Not unless you're on a Windows platform using either Microsoft's Visual C++ product or an equivalent like Mingw.

If your professor insists on using these proprietary libraries for his assignments, you'll have no choice but to use a Microsoft platform to write your assignments on.

Okay thanks Knight. That helps to know that. I guess I'll just have to use the computer room. *sigh*

Thanks for all your help, guys.
 

lloyddean

macrumors 65816
May 10, 2009
1,047
19
Des Moines, WA
Let's us explore another possiblity - that in fact you need only a couple of functions from these Windows headers.

Try creating an empty file for each "missing" header file.

This will allow the compilation to proceed further allowing the compiler to in turn complain of missing prototypes instead.

If the number of missing Windows functions you are using is small enough alternative implementations that provide the missing functions may be possible. This will could allow you to continue working on your own computer.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.