1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

xcode help

Discussion in 'Mac Programming' started by tomflaherty2, Jan 31, 2012.

  1. macrumors newbie

    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?

  2. macrumors newbie

    Sorry for replying to my own thread, but I'm now also getting this error for conio.h.

  3. macrumors Pentium


    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 ?
  4. macrumors newbie

    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?

  5. macrumors 65816

    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?
  6. macrumors newbie

    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?


    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?
  7. macrumors Pentium


    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.
  8. macrumors newbie

    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?
  9. macrumors 65816

  10. macrumors newbie

    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?

  11. macrumors Pentium


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

    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.
  12. macrumors newbie

    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.
  13. lloyddean, Jan 31, 2012
    Last edited: Jan 31, 2012

    macrumors 6502a

    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.

Share This Page