为iOS编译expat – 命令/ bin / sh失败,退出代码为77
我正在尝试将libkml库导入我的iOS项目。 我意识到expat库不能链接(?),因此必须再次为它构建expat源。
我找到了一个SO链接,其中一位绅士提到他可以成功地将expat与他的iOS SDK 5.1联系起来: 如何使用iOS SDK 5.1编译expat?
我尝试使用github中提供的脚本,如上面链接中所述。
但是,我在脚本的运行阶段收到错误。 我无法充分利用它,但我需要帮助来解决这个问题。
使用的脚本与github链接相同。 项目中的C ++标准库设置为“Compiler default”,我认为它是LLVM C ++。 以下是config.log的输出,我无法理解我的理解水平。 请帮我解决这个问题并构建库以将其与我的项目链接:
This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by expat configure 2.0.1, which was generated by GNU Autoconf 2.59. Invocation command line was $ ./configure --prefix=/Users/raj/Projects/test/bin/iPhoneSimulator5.0-i386.sdk --host=i386-apple-darwin --enable-static ## --------- ## ## Platform. ## ## --------- ## hostname = Rajs-MacBook-Pro.local uname -m = x86_64 uname -r = 12.3.0 uname -s = Darwin uname -v = Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 /usr/bin/uname -p = i386 /bin/uname -X = unknown /bin/arch = unknown /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown hostinfo = Mach kernel version: Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 Kernel configured for up to 8 processors. 4 processors are physically available. 8 processors are logically available. Processor type: i486 (Intel 80486) Processors active: 0 1 2 3 4 5 6 7 Primary memory available: 4.00 gigabytes Default processor set: 100 tasks, 561 threads, 8 processors Load average: 2.90, Mach factor: 5.09 /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin PATH: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/local/bin PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/local/bin PATH: /Applications/Xcode.app/Contents/Developer/usr/bin PATH: /Applications/Xcode.app/Contents/Developer/usr/local/bin PATH: /Applications/Xcode.app/Contents/Developer/Tools PATH: /usr/bin PATH: /bin PATH: /usr/sbin PATH: /sbin ## ----------- ## ## Core tests. ## ## ----------- ## configure:2092: checking build system type configure:2110: result: i386-apple-darwin12.3.0 configure:2118: checking host system type configure:2132: result: i386-apple-darwin configure:2148: checking for i386-apple-darwin-gcc configure:2174: result: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc configure:2456: checking for C compiler version configure:2459: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc --version &5 i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:2462: $? = 0 configure:2464: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -v &5 Using built-in specs. Target: i686-apple-darwin11 Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) configure:2467: $? = 0 configure:2469: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -V &5 llvm-gcc-4.2: argument to `-V' is missing configure:2472: $? = 1 configure:2495: checking for C compiler default output file name configure:2498: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -I/Users/raj/Projects/test/include -arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/raj/Projects/test/lib conftest.c >&5 ld: library not found for -lcrt1.10.6.o collect2: ld returned 1 exit status configure:2501: $? = 1 configure: 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. */ | | int | main () | { | | ; | return 0; | } configure:2540: error: C compiler cannot create executables See `config.log' for more details. ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_build=i386-apple-darwin12.3.0 ac_cv_build_alias=i386-apple-darwin12.3.0 ac_cv_env_CC_set=set ac_cv_env_CC_value=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc ac_cv_env_CFLAGS_set=set ac_cv_env_CFLAGS_value='-arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -I/Users/raj/Projects/test/include' ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_set=set ac_cv_env_CPP_value=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-cpp-4.2 ac_cv_env_CXXCPP_set=set ac_cv_env_CXXCPP_value=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-cpp-4.2 ac_cv_env_CXXFLAGS_set=set ac_cv_env_CXXFLAGS_value='-arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -I/Users/raj/Projects/test/include' ac_cv_env_CXX_set=set ac_cv_env_CXX_value=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++ ac_cv_env_F77_set= ac_cv_env_F77_value= ac_cv_env_FFLAGS_set= ac_cv_env_FFLAGS_value= ac_cv_env_LDFLAGS_set=set ac_cv_env_LDFLAGS_value='-arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/raj/Projects/test/lib' ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set=set ac_cv_env_host_alias_value=i386-apple-darwin ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_host=i386-apple-darwin ac_cv_host_alias=i386-apple-darwin ac_cv_prog_CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc ## ----------------- ## ## Output variables. ## ## ----------------- ## AR='' AS='' CC='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' CFLAGS='-arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -I/Users/raj/Projects/test/include' CPP='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-cpp-4.2' CPPFLAGS='' CXX='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++' CXXCPP='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-cpp-4.2' CXXFLAGS='-arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -I/Users/raj/Projects/test/include' DEFS='' DLLTOOL='' ECHO='echo' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='' EXEEXT='' F77='' FFLAGS='' FILEMAP='' INSTALL_DATA='' INSTALL_PROGRAM='' INSTALL_SCRIPT='' LDFLAGS='-arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/raj/Projects/test/lib' LIBAGE='5' LIBCURRENT='6' LIBOBJS='' LIBREVISION='2' LIBS='' LIBTOOL='' LN_S='' LTLIBOBJS='' OBJDUMP='' OBJEXT='' PACKAGE_BUGREPORT='expat-bugs@libexpat.org' PACKAGE_NAME='expat' PACKAGE_STRING='expat 2.0.1' PACKAGE_TARNAME='expat' PACKAGE_VERSION='2.0.1' PATH_SEPARATOR=':' RANLIB='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ranlib' SHELL='/bin/sh' STRIP='' ac_ct_AR='' ac_ct_AS='' ac_ct_CC='' ac_ct_CXX='' ac_ct_DLLTOOL='' ac_ct_F77='' ac_ct_OBJDUMP='' ac_ct_RANLIB='' ac_ct_STRIP='' bindir='${exec_prefix}/bin' build='i386-apple-darwin12.3.0' build_alias='' build_cpu='i386' build_os='darwin12.3.0' build_vendor='apple' datadir='${prefix}/share' exec_prefix='NONE' host='i386-apple-darwin' host_alias='i386-apple-darwin' host_cpu='i386' host_os='darwin' host_vendor='apple' includedir='${prefix}/include' infodir='${prefix}/info' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localstatedir='${prefix}/var' mandir='${prefix}/man' oldincludedir='/usr/include' prefix='/Users/raj/Projects/test/bin/iPhoneSimulator5.0-i386.sdk' program_transform_name='s,x,x,' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target_alias='' ## ----------- ## ## confdefs.h. ## ## ----------- ## #define PACKAGE_BUGREPORT "expat-bugs@libexpat.org" #define PACKAGE_NAME "expat" #define PACKAGE_STRING "expat 2.0.1" #define PACKAGE_TARNAME "expat" #define PACKAGE_VERSION "2.0.1" configure: exit 77
如错误所示,我错过了C编译器。 然后我下载了Xcode命令行工具,然后可以修复这些错误。