奇怪的丢失标头在mac上

时间:2014-08-22 17:47:11

标签: c++ xcode macos

我是mac的新手,所以请继续和我在一起。我必须编译一个在linux中编译和运行的自制软件包,并使用boost库。首先,我从编译器中获得了所有类型的异常错误,直到我意识到我使用的是gcc 4.2。我安装了4.8。我尝试使用clang但由于某种原因(我不明白)安装的版本是2.1:

$ clang --version
Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

我正在使用OS X 10.9.4,内核版本:Darwin 13.3.0。

我使用macports安装了boost。当我尝试编译时,编译器无法找到标题,所以我做了:

     export DYLD_LIBRARY_PATH=/opt/local/include/

并且编译器找到了它们。现在,当我运行makefile时,我得到:

In file included from /opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include/stdint.h:9:0,
                 from /opt/local/include/gcc48/c++/cstdint:41,
                 from /opt/local/include/gcc48/c++/bits/char_traits.h:376,
                 from /opt/local/include/gcc48/c++/ios:40,
                 from /opt/local/include/gcc48/c++/ostream:38,
                 from /opt/local/include/gcc48/c++/iostream:39,
                 from ../src/space/space.h:4,
                 from ../src/space/grid_space.cpp:1:
/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h:27:32: fatal error: sys/_types/_int8_t.h: No such file or directory
 #include <sys/_types/_int8_t.h>
                                ^
compilation terminated.

我无法找到sys / _types / _int8_t.h的位置或者如果丢失则如何安装它。我已经阅读了xcode-select -install,但我得到的是:

xcode-select -install
Usage: xcode-select -print-path
   or: xcode-select -switch <xcode_folder_path>
   or: xcode-select -version
Arguments:
   -print-path                     Prints the path of the current Xcode folder
   -switch <xcode_folder_path>     Sets the path for the current Xcode folder
   -version                        Prints xcode-select version information

xcodebuild -version
Xcode 5.1.1
Build version 5B1008

发生了什么事?我在哪里可以找到sys / _types / _int8_t.h?

我想使用clang,但版本太旧了,我需要C ++ 11支持。 Clang安装正确,应该是,并且:

 $ xcode-select -p
Usage: xcode-select -print-path
   or: xcode-select -switch <xcode_folder_path>
   or: xcode-select -version
Arguments:
   -print-path                     Prints the path of the current Xcode folder
   -switch <xcode_folder_path>     Sets the path for the current Xcode folder
   -version                        Prints xcode-select version information

0 个答案:

没有答案
相关问题