为ios创建静态c lib

时间:2011-10-12 16:19:30

标签: ios static

我想为iphone编译一个c库。我对此完全缺乏经验,并用Google搜索了她:Compile C lib for iPhone

我要构建的项目的原始源代码在我的mac上编译得很好,结果包含以下目录结构

bin     include lib     share

所以在那之后,我现在想要构建这些东西,以便我可以在我的iphone上使用它。对于第一步,我只需从上面的链接复制并粘贴configure命令,然后按Enter键。这是结果:

./configure --build=arm-apple-darwin --enable-static=yes --enable-shared=no         CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 CFLAGS="-pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=3.1.2 -gdwarf-2 -mthumb -I/Library/iPhone/include -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk -mdynamic-no-pic" CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar AS=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/as LIBTOOL=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool STRIP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/strip RANLIB=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ranlib
checking build system type... arm-apple-darwin
checking host system type... arm-apple-darwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./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 host system type... posix
checking for gcc... /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1
checking whether the C compiler works... no
configure: error: in `/path/to/gwenhywfar-4.3.0-src':
configure: error: C compiler cannot create executables

但问题是什么?怎么修这个呢?如果我认为阻止创建二进制可执行文件将是解决方案,我是对的吗?

0 个答案:

没有答案