NO such file or directory for the files -----stdarg.h and float.h?

有些话、适合烂在心里 提交于 2020-01-01 06:37:08

问题


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


回答1:


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)




回答2:


I ran into the same problem, and couldn't fix the problem with all other answers here, so I tried:

cd /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/include
sudo mv stdarg.h stdarg.h.original
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/lib/gcc/arm-apple-darwin9/4.0.1/include/stdarg.h

and the compile error is gone!




回答3:


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




回答4:


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.




回答5:


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.




回答6:


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




回答7:


add additional flags like below

CFLAGS += -I"$(YOUR_SYSROOT)/usr/lib/gcc/arm-apple-darwin10/4.2.1/include"
CPPFLAGS += -I"$(YOUR_SYSROOT)/usr/include/c++/4.2.1"
CPPFLAGS += -I"$(YOUR_SYSROOT)/usr/include/c++/4.2.1/armv6-apple-darwin10" 


来源:https://stackoverflow.com/questions/1550397/no-such-file-or-directory-for-the-files-stdarg-h-and-float-h

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