编译 – 几个lib的iOS编译(armv7,i386).配置脚本:C预处理器失败健全检查

编译 – 几个lib的iOS编译(armv7,i386).配置脚本:C预处理器失败健全检查,第1张

概述我一直在为iOS编写不同的图书馆,直到iOS5没有问题.好的,显然我的问题是,iOS5 SDK不再包含GNU gcc编译器了.只有llvm和clang可用. 我的问题是,我无法完成任何库的“配置”脚本.它总是失败与: configure: error: C preprocessor "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin 我一直在为iOS编写不同的图书馆,直到iOS5没有问题.好的,显然我的问题是,iOS5 SDK不再包含GNU gcc编译器了.只有llvm和clang可用.

我的问题是,我无法完成任何库的“配置”脚本.它总是失败与:

configure: error: C preprocessor "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" fails sanity check

gcc只是一个到llvm编译器的符号链接.如果我把它设置为clang,它会产生相同的错误. (只是一个更好的语法错误表示)

这里config.log的重要部分:

configure:3338: checking how to recognise dependent librarIEsconfigure:3514: result: pass_allconfigure:3993: checking how to run the C preprocessorconfigure:4111: result: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gccconfigure:4135: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -B/Developer/Platforms/iPhoneOS.platform/Developer/usr -arch armv7 -miphoneos-version-min=5.0 -gDWarf-2 -mthumb -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/system conftest.cconftest.c:14: error: expected '=',',';','asm' or '__attribute__' before 'error'configure:4141: $? = 1configure: Failed program was:| /* confdefs.h.  */| | #define PACKAGE_name "expat"| #define PACKAGE_TARname "expat"| #define PACKAGE_VERSION "2.0.1"| #define PACKAGE_STRING "expat 2.0.1"| #define PACKAGE_BUGREPORT "expat-BUGs@libexpat.org"| /* end confdefs.h.  */| #ifdef __STDC__| # include <limits.h>| #else| # include <assert.h>| #endif|            Syntax errorconfigure:4135: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -B/Developer/Platforms/iPhoneOS.platform/Developer/usr -arch armv7 -miphoneos-version-min=5.0 -gDWarf-2 -mthumb -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/system conftest.cconftest.c:14: error: expected '=','asm' or '__attribute__' before 'error'configure:4141: $? = 1configure: Failed program was:| /* confdefs.h.  */| | #define PACKAGE_name "expat"| #define PACKAGE_TARname "expat"| #define PACKAGE_VERSION "2.0.1"| #define PACKAGE_STRING "expat 2.0.1"| #define PACKAGE_BUGREPORT "expat-BUGs@libexpat.org"| /* end confdefs.h.  */| #ifdef __STDC__| # include <limits.h>| #else| # include <assert.h>| #endif|            Syntax errorconfigure:4210: error: C preprocessor "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" fails sanity checkSee `config.log' for more details.

这是我的环境.有点过分,但它可以正常工作iOS4.X.

# definesDEVROOT=/Developer/Platforms/iPhoneOS.platform/DeveloperSDKROOT=$DEVROOT/SDKs/iPhoneOS5.0.sdk# BUILD STUFFexport CXXFLAGS="-B/Developer/Platforms/iPhoneOS.platform/Developer/usr -arch armv7 -miphoneos-version-min=5.0 -gDWarf-2 -mthumb -isysroot $SDKROOT -L$SDKROOT/usr/lib/system"export CPPFLAGS="$CXXFLAGS"export CFLAGS="$CXXFLAGS"export CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gccexport CXXCPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++#export CXX=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++export CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gccexport LD=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ldexport RANliB=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ranlibexport AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arexport STRIP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/stripexport liBTOol=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtoolexport INSTALL_DIR=/Users/mrIEdel/MPI/CrossCompiling/armv7_dev_installexport CPATH=$INSTALL_DIR/includeexport liBRARY_PATH=$INSTALL_DIR/lib

我一直在努力想出这个数周,但没有运气.我觉得其他人一定会遇到这个问题.但谷歌没有提出什么.有一段时间,我试图使用gaspreprocessor.pl,但也没有任何运气.

啊,我的配置调用总是类似于:

./configure --prefix=$INSTALL_DIR --disable-shared --enable-static --host=arm-apple-darwin

我想指出,这个确切的问题发生在我使用配置写字板的所有库.举几个例子:apr,apr-util,expat,log4cxx等…我甚至不知道所需的输出应该是什么.代码中间只有一个奇怪的“语法错误”.难怪它不编译:).

帮助和提示如何进行将不胜感激.
谢谢.

解决方法 我遇到同样的问题.经过一些戳,我的问题原来是我明确地设置CPP.不要设置(实际上,如果设置了’unset’).如果没有设置,配置会默认尝试$CC -E.如果设置,configure不会自动添加-E.此外,将CPPFLAGS设置为-E不起作用,因为这些标志也被传递到其他步骤. 总结

以上是内存溢出为你收集整理的编译 – 几个lib的iOS编译(armv7,i386).配置脚本:C预处理器失败健全检查全部内容,希望文章能够帮你解决编译 – 几个lib的iOS编译(armv7,i386).配置脚本:C预处理器失败健全检查所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1095192.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存