开发者

NO such file or directory for the files -----stdarg.h and 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 th开发者_StackOverflowe 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


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:

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!


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


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.


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.


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

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" 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜