包含语句:找不到 SDL/SDL.h 文件 [英] Include statement: can't find SDL/SDL.h file

查看:46
本文介绍了包含语句:找不到 SDL/SDL.h 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的理解是,当我在 xcode 中构建 C++ 项目时,我在 角括号形式 然后使用 xcode 的 C++ 编译器在 /System/Library/Frameworks/ 中查找文件.我认为因为这个答案:当我使用 #include <OpenGL/gl.h> 行时在我的 xcode 项目中,它在哪里查找 gl.h 文件?

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?

我在 /System/Library/Frameworks/SDL.framework/headers/SDL.h 有一个 SDL.h 文件(我下载了文件夹 SDL.framework 并将它复制到那个位置命令 sudo cp -r/Volumes/SDL/SDL.framework System/Library/Frameworks)

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)

但是我在 xcode 项目中的一个文件中的 include 语句仍然出现此错误:

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

我是否正确安装了 SDL 框架?为什么 xcode 看不到它?

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

推荐答案

在您的项目构建设置下,搜索搜索".添加标头搜索路径到 SDL 目录 /System/Library/Frameworks/SDL.framework/headers

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>

希望对你有用.

您也可以查看此链接:http://meandmark.com/blog/2012/01/使用-sdl-with-xcode-4/

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

它适用于 Xcode 4,但看起来所有的部分都在那里.

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

这篇关于包含语句:找不到 SDL/SDL.h 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆