gpt4 book ai didi

c++ - 包含语句 : can't find SDL/SDL. h 文件

转载 作者:搜寻专家 更新时间:2023-10-31 01:47:27 25 4
gpt4 key购买 nike

我的理解是,当我在 xcode 中构建 C++ 项目时,我在 angle-bracket form 中的一个 C 文件中有一个包含行然后与 xcode 配合使用的 C++ 编译器会在 /System/Library/Frameworks/ 中查找该文件。我认为是因为这个答案: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)

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

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

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

最佳答案

在您的项目Build Settings 下,搜索“search”。在SDL目录下添加header搜索路径/System/Library/Frameworks/SDL.framework/headers

应该能够在之后执行此操作:

#include <SDL.h>

希望对你有用。

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

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

关于c++ - 包含语句 : can't find SDL/SDL. h 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19150739/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com