XCode 4.3 中 stdlib.h 的位置是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9400316/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the location of stdlib.h in XCode 4.3?
提问by Jake Badlands
Please tell me, what is the location of stdlib.h in XCode 4.3 ?
请告诉我,stdlib.h 在 XCode 4.3 中的位置是什么?
采纳答案by trojanfoe
What was in /Developer
in Xcode versions prior to 4.3 is now within the Xcode.app
bundle. There are several, one for each supported SDK and Platform:
什么是/Developer
在之前4.3版本的Xcode现在是内Xcode.app
包。有几个,每个支持的 SDK 和平台一个:
$ find /Applications/Xcode.app -name stdlib.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/c++/4.2.1/tr1/stdlib.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/stdlib.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/include/c++/4.2.1/tr1/stdlib.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/include/stdlib.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/tr1/stdlib.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdlib.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/tr1/stdlib.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/stdlib.h
回答by bames53
If you install the command line tools (Xcode > Preferences > Downloads), then the file is present at/usr/include/stdlib.h
.
如果您安装命令行工具(Xcode > Preferences > Downloads),则该文件位于/usr/include/stdlib.h
.
回答by larick
I think you should be using unistd.h
instead of stdlib.h
. I had an issue trying to use sleep() when importing stdlib.h
and I had to import unistd.h
.
我认为你应该使用unistd.h
而不是stdlib.h
. 我在导入时尝试使用 sleep() 时遇到问题stdlib.h
,我不得不导入unistd.h
.