我使用OS X 10.10.2,下载 Clang for Mac OS X v. 3.6.0,并尝试编译一个简单的Hello World程序。
我使用以下命令:
(假设您将clang
下载到。
)
cd .
./clang+llvm-3.6.0-x86_64-apple-darwin/bin/clang++ main.cpp
结果是这样的:
In file included from main.cpp:1:
In file included from ./clang+llvm-3.6.0-x86_64-apple-darwin/bin/../include/c++/v1/iostream:37:
./clang+llvm-3.6.0-x86_64-apple-darwin/bin/../include/c++/v1/__config:23:10: fatal error: 'unistd.h' file not
found
这是有道理的,因为没有 unistd.h
文件,这可以通过验证。
find . -name unistd.h
搜索无结果,返回0
。
我尝试下载LibC++源代码版本3.6.0,但是其中甚至没有unistd.h
。我在哪里可以找到该文件的官方/原始版本以及被该文件引用和元引用的文件?
find / -name unistd.h
只在/Applications/Xcode/*
中查找文件,而我尝试避免使用 Xcode。 - user4664340