CPP 在 Mac 上未能通过健全性检查

标签 c macos

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

C 预处理器“/lib/cpp”未通过完整性检查

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

配置:错误: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

最佳答案

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

在 dmg 文件列表中查找“命令行工具”。它应该看起来像这样:

Command Line Tools

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

关于CPP 在 Mac 上未能通过健全性检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49931136/

相关文章:

macos - PNG 图像可以包含多个页面吗?

objective-c - 在 osX for cocoa 应用程序中显示真实颜色

c - 高级叉式炸弹免疫杀伤信号

ruby-on-rails - 无法更新 RubyGems

c - 即使在 centos 7.3 中不存在 ExecStart 进程后,Systemd 服务状态仍保持运行

c - char* 指向哪里?

macos - 如何创建一个从一个点(CGPoint)到另一点 "points"的CGVector

html - 如何放大Safari Web Inspector : Details sidebar?

c - 如何让程序在没有内容可读时自行终止

c - 在 `if` 条件下将变量赋值为零时会发生什么?