Basic compiling questions...
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?
#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?
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.
So, try SDL_image/SDL_image.h or just SDL_image.h and make sure you've included the framework.
Well, that was too easy
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?
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?
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...
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Basic questions about rigid body physics | hangt5 | 15 | 5,522 |
Jul 7, 2005 04:18 PM Last Post: hangt5 |
|

