gpt4 book ai didi

linux - 配置:错误:C 预处理器未能通过健全性检查

转载 作者:IT王子 更新时间:2023-10-29 00:46:54 31 4
gpt4 key购买 nike

我正在 Ubuntu 12.04 x86_64 上编译几个库。首先,我用 GCC 4.7.2 编译了库,一切顺利。然后我尝试用 Inte Composer 2013 u2 重新编译它们。为此我做了:

export CC=/opt/intel/composer_xe_2013.2.146/bin/intel64/icc
export CPP=/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc

然后我运行 ./configure 并得到以下错误:

checking how to run the C preprocessor... /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc
configure: error: in `/var/www/workspace/freetype/freetype-2.4.11/builds/unix':
configure: error: C preprocessor "/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc" fails sanity check
See `config.log' for more details
make: *** [setup] Error 1

配置日志文件包含此错误:

configure:3345: checking how to run the C preprocessor
configure:3415: result: /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc
configure:3435: /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc conftest.c
conftest.c(14): error: identifier "Syntax" is undefined
Syntax error
^

conftest.c(14): error: expected a ";"

compilation aborted for conftest.c (code 2)

configure:3435: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "FreeType"
| #define PACKAGE_TARNAME "freetype"
| #define PACKAGE_VERSION "2.4.11"
| #define PACKAGE_STRING "FreeType 2.4.11"
| #define PACKAGE_BUGREPORT "freetype@nongnu.org"
| #define PACKAGE_URL ""
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:3435: /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc conftest.c
conftest.c(14): error: identifier "Syntax" is undefined
Syntax error
^

conftest.c(14): error: expected a ";"

compilation aborted for conftest.c (code 2)

这里有什么问题吗?

最佳答案

问题很可能是 GNU 使隐式变量表示“您的 C++ 编译器”不是 CPP 而是 CXX,而 CPP 是表示“您的 C 预处理器”的隐式变量;所以你的

export CPP=/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc

告诉 configure icpc 是预处理器并大概离开 CXX默认为 g++。

这由 ./configure 错误支持:

checking how to run the C preprocessor... /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc

尝试:

export CXX=/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc

或者只是:

./configure CXX=/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc

关于linux - 配置:错误:C 预处理器未能通过健全性检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15041937/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com