我想要編譯ZeroMQ C語言綁定,以便能夠使用它在iPhone上,這裏是我的配置選項:編譯C LIB爲iPhone
./configure --host=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
它實際上是配置和編譯罰款,但是當我將它添加到Xcode Frameworks部分時,我得到警告:ld: warning: in /path/to/app/libzmq.a, file was built for unsupported file format which is not the architecture being linked (armv7)
和很多符號未找到錯誤。
如果我將當前活動架構從armv6更改爲armv7,則警告消息會將其更改爲armv6。 我在做什麼錯?
感謝, 丹
感謝您的回答,但我如何定義架構? arm-apple-darwin10-gcc-4.2.1不支持-arch選項。 順便說一句,lipo -info爲我的lib說,編譯爲x86_64,這是奇怪的。 – Dan 2010-09-01 20:39:00
對不起,我沒有注意到你沒有通過'-arch'選項。我不確定它爲什麼不接受它,但爲什麼不嘗試使用'/ Developer/Platforms /.../ gcc'呢?我只是查找了我用過的C庫的配置命令,而且經常可以工作。 – 2010-09-01 21:12:45
謝謝,我終於能夠使用這個問題的腳本進行編譯了 - http://stackoverflow.com/questions/1602182/cross-compile-autotools-based-libraries-for-official-iphone-sdk – Dan 2010-09-02 18:41:04