CPP无法在Mac上进行健全性检查

时间:2018-04-19 22:28:14

标签: c macos

我到处搜索,无法找到如何在我的Mac上解决这个编译问题:

C预处理程序“/ lib / cpp”无法进行健全性检查

更新:我正在尝试使用./configure编译psqlodbc我得到以下内容:

configure:error:C预处理器“/ lib / cpp”无法进行健全性检查

有人会非常友善地告诉我要检查什么来开始解决可能出错的问题吗?我已经读过这个问题通常是由多个版本的编译器和XCode引起的。但是,我不知道如何开始。谢谢!

这是我的输出:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking -Wall is a valid compile option... yes
./configure: line 4392: /usr/local/iODBC: is a directory
./configure: line 4395: /usr/local/iODBC: is a directory
configure: using  
checking last argument to SQLColAttribute is SQLLEN *... no
checking for pg_config... no
checking for prove... prove
checking build system type... x86_64-apple-darwin17.5.0
checking host system type... x86_64-apple-darwin17.5.0
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-apple-darwin17.5.0 file names to x86_64-apple-darwin17.5.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin17.5.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... failed
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... no
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... no
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/Users/tedhtl/Downloads/psqlodbc-10.01.0000':
configure: error: C preprocessor "/lib/cpp" fails sanity check

1 个答案:

答案 0 :(得分:1)

转到http://developer.apple.com/xcode,然后点击右上角的蓝色“下载”按钮。登录网站后,滚动到页面底部,您会看到“查看更多下载”链接。

在dmg文件列表中查找“命令行工具”。它应该是这样的:

Command Line Tools

获取该DMG,然后双击安装程序。它安装了可以从命令行(或Terminal.app)访问的工具(如/usr/bin/cpp)。