PDA

View Full Version : xcode help




tomflaherty2
Jan 31, 2012, 06:04 AM
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
Jan 31, 2012, 07:16 AM
Sorry for replying to my own thread, but I'm now also getting this error for conio.h.

Thanks.

KnightWRX
Jan 31, 2012, 07:28 AM
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
Jan 31, 2012, 08:04 AM
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
Jan 31, 2012, 08:06 AM
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
Jan 31, 2012, 08:26 AM
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
Jan 31, 2012, 08:37 AM
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 :

#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
Jan 31, 2012, 08:41 AM
Just add them to your project. Remember to then include them using this syntax :

#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?

ScoobyMcDoo
Jan 31, 2012, 09:44 AM
Can you point me towards the thread you replied to, so I can have a look at the different solution?


http://forums.macrumors.com/showthread.php?t=1316639

tomflaherty2
Jan 31, 2012, 09:50 AM
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
Jan 31, 2012, 10:49 AM
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
Jan 31, 2012, 02:55 PM
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
Jan 31, 2012, 03:28 PM
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.