文件 -----stdarg.h 和 float.h 没有这样的文件或目录吗?
我正在 xcode 项目中使用 .mm 扩展名上的一些文件来编译这些文件,在添加此编译器后,我们在构建设置中添加了 LLVM-GCC 4.2,这显示了错误
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/include/stdarg.h:4:25:错误:stdarg.h:没有这样的文件或目录
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/include/float.h:8:24:错误:float.h:没有这样的文件或目录
我有不知道如何消除此错误任何有助于消除此错误的帮助。
谢谢巴尔拉吉
I am using some files on .mm extension in the xcode project for compiling these files we have added the LLVM-GCC 4.2 in the build setting after adding this compiler this showing the error
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/include/float.h:8:24: error: float.h: No such file or directory
i have no idea how to remove this error any help to remove this error.
thanks
Balraj
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Mac OSX 上默认使用的 gcc 4.2 不支持这些标头。
切换到版本4.0(描述此处)
These headers aren't supported in gcc 4.2 which is used by default on Mac OSX.
Switch to version 4.0 (it is described here)
我遇到了同样的问题,并且无法用这里的所有其他答案解决问题,
所以我尝试了:
编译错误消失了!
I ran into the same problem, and couldn't fix the problem with all other answers here,
so I tried:
and the compile error is gone!
我已经在 GCC 4.0 编译器上有了这个,更改为 LLVM 编译器 1.6 对我有用。使用 Mac OS X 10.7.3 Xcode 3.2.5
I had this already on the GCC 4.0 compiler Changing to the LLVM compiler 1.6 worked for me. Using Mac OS X 10.7.3 Xcode 3.2.5
我也遇到了这个问题,并且更改为 GCC 4.0 并没有为我解决这个问题。我还必须将活动 SDK(Xcode 编辑器或控制台窗口左上角的下拉菜单)从 10.4(基础 SDK)更改为 10.6(我运行的是 Snow Leopard)。
我不知道这可能会对您的开发产生什么影响,但这对于我的问题来说已经足够好了,因为我只是为简单的事情做一个基本的命令行工具。
I ran into this problem as well, and changing to GCC 4.0 didn't fix it for me. I also had to change my active SDK (drop-down in the upper-left corner of the Xcode editor or console window) from 10.4 (Base SDK) to 10.6 (I'm running Snow Leopard).
I don't know what implications this might have on your development, but it was good enough for my problem because I'm just doing a basic command-line tool for easy stuff.
安装 SDL 框架后,我在 xcode 中构建 Hello World 应用程序时遇到了此错误。按照书本进行标准安装,使用 xcode 3.3.2 到 Snow Leopard OSX 10.6.3 会抛出这些错误,
“stdarg.h:没有这样的文件或目录”
“float.h:没有这样的文件或目录”,
因为它默认为 SDK 10.4。
如果您遇到该问题,请将 SDK 设置为 10.6,这样您就不会受到影响。
I ran into this error building my Hello World app in xcode after doing an install of the SDL framework. Doing the standard install, by the book, into Snow Leopard OSX 10.6.3 with xcode 3.3.2 threw those errors,
"stdarg.h: No such file or directory"
"float.h: No such file or directory"
because it defaults to SDK 10.4.
If you have that issue set the SDK to 10.6 and you should be in the clear.
根据我的测试并根据上面的建议,该问题与 Base SDK 版本密切相关;也就是说,早期的 SDK 仅适用于 GCC 4.0,而后续的 SDK 则适用于 GCC 4.0 或 4.2(以及较新的 LLVM 选项)。
总结应该有效的选项:
iOS 项目/目标的基础 SDK:
iOS 3.2 及更早版本: GCC 4.0
iOS 4.0 及更高版本: GCC 4.0、GCC 4.2、LLVM GCC 4.2、LLVM Clang
Mac OS X 项目/目标的基础 SDK:
Mac OS X 10.5 及更早版本: GCC 4.0
Mac OS X 10.6 及更高版本: GCC 4.0、GCC 4.2、LLVM GCC 4.2、LLVM Clang
From my testing and based on what's been suggested above, the issue goes hand-in-hand with the Base SDK version; that is, earlier SDKs will only work with GCC 4.0, while later SDKs work with GCC 4.0 or 4.2 (and the newer LLVM options).
To summarize options that should work:
Base SDK for iOS projects/targets:
iOS 3.2 and earlier: GCC 4.0
iOS 4.0 and later: GCC 4.0, GCC 4.2, LLVM GCC 4.2, LLVM Clang
Base SDK for Mac OS X projects/targets:
Mac OS X 10.5 and earlier: GCC 4.0
Mac OS X 10.6 and later: GCC 4.0, GCC 4.2, LLVM GCC 4.2, LLVM Clang
添加如下所示的附加标志
add additional flags like below