Han*_*Sun 17 c c++ macos xcode
我试图通过使用gcc -v以下方法在Mac OS X(Mavericks)中找到C编译器的默认包含路径:
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
Run Code Online (Sandbox Code Playgroud)
它似乎告诉我道路是/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1,但我担心这不是真正的道路.我认为包含标准C库的真正途径是/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include因为它<sys/syscall.h>位于后面的路径中,即/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/syscall.h
有没有人有关于如何在Mac OS X中查看C库的所有默认包含路径的想法?
dev*_*ull 45
您需要询问预处理器,而不是gcc,以告知默认的包含路径.
你可以说:
`gcc -print-prog-name=cc1` -v
Run Code Online (Sandbox Code Playgroud)
为了列出C和C++的默认包含路径:
`gcc -print-prog-name=cc1plus` -v
Run Code Online (Sandbox Code Playgroud)
(您在上面列出的路径是在构建时用于配置 GCC 的路径.)
列出默认包含路径的另一种方法是:
gcc -x c -v -E /dev/null
gcc -x c++ -v -E /dev/null # (for C/C++)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
30117 次 |
| 最近记录: |