iDevGames Forums
Basic compiling questions... - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Basic compiling questions... (/thread-4929.html)



Basic compiling questions... - WhatMeWorry - Oct 9, 2005 09:16 PM

Ok, got some code (not mine) I'm porting to Xcode and have this line:

#include <SDL/SDL_image.h>

which returns

error SDL/SDL_image.h: no such file or directory

Is the "SDL" above a directory? If so, is it relative and from what?

In frustration, I go to spotlight and search for SDL_image.h which returns
a long path which I stupidly stick into the offending #include.

#include </Library/Frameworks/SDL_image.framework/Versions/A/Headers/SDL_image.h>

Everything compiles and runs fine. Now I realize that this is *bad* to put
a hardcoded path into my program. But what would be a more acceptable
solution?


Basic compiling questions... - longjumper - Oct 9, 2005 10:00 PM

In most cases, it's #include<FrameworkName/Headerfile>

So, try SDL_image/SDL_image.h or just SDL_image.h and make sure you've included the framework.


Basic compiling questions... - WhatMeWorry - Oct 9, 2005 10:33 PM

Well, that was too easy Smile Thanks. Can't say I've ever come across that before.

Say, just for discussion sake, if frameworks were out of the equation, would the
best approach then be to stick that long path name in the Header Search Path
of the Xcode's project?


Basic compiling questions... - Steven - Oct 9, 2005 10:38 PM

If it's not in a framework, the header ought to go in /usr/include or /usr/local/include or some path already in the search path - that's the whole point. If it's not, sure you could add it to the list...