Include statement: can't find SDL/SDL.h file

送分小仙女□ 提交于 2021-01-27 06:44:50

问题


My understanding is that when I build a C++ project in xcode and I have an include line in one of my C files in angle-bracket form then the C++ compiler that works with xcode looks in /System/Library/Frameworks/ to find the file. I think that because of this answer: when I use the line #include <OpenGL/gl.h> in my xcode project, where does it look for the gl.h file?

I have an SDL.h file at /System/Library/Frameworks/SDL.framework/headers/SDL.h (I downloaded the folder SDL.framework and copied it to that location with the command sudo cp -r /Volumes/SDL/SDL.framework System/Library/Frameworks)

But my include statement in one of the files in my xcode project still gives this error:

#include <SDL/SDL.h> //throws file not found

Did I properly install the SDL framework? Why doesn't xcode see it?


回答1:


Under your projects Build Settings, do a search for "search". Add a header search path to the SDL directory /System/Library/Frameworks/SDL.framework/headers

Should be able to just do this after:

#include <SDL.h>

Hope that works for you.

You can also check out this link: http://meandmark.com/blog/2012/01/using-sdl-with-xcode-4/

It's for Xcode 4, but it looks like all the pieces are there.



来源:https://stackoverflow.com/questions/19150739/include-statement-cant-find-sdl-sdl-h-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!