Almost :-) I was looking to do the same thing - thanks for the helping hand with the script.
I tried yours - failed, the command 'lipo -info <libname>' said I had created an i386 library. Ahhhhh I thought to meself... So here's my build script, derived from yours: ----------------- beginning of bash script file --------------- #!/bin/bash MY_FLAGS="-arch armv6 -pipe -Wno-trigraphs -fpascal-strings -fasm- blocks -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 - fvisibility=hidden -miphoneos-version-min=2.0 -gdwarf-2 -mthumb -I/ Library/iPhone/include -isysroot /Developer/Platforms/ iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk" export CFLAGS="$MY_FLAGS" export CXXFLAGS="$MY_FLAGS" export CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm- apple-darwin9-g++-4.0.1 export GXX=$CC export CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ cpp export AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar export AS=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/as export LIBTOOL=/Developer/Platforms/iPhoneOS.platform/Developer/usr/ bin/libtool export STRIP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ strip export RANLIB=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ ranlib CONFIGURE="./configure --host=arm-apple-darwin --prefix=/usr/local/ iphone-protobuf203 --program-prefix=iphone --disable-shared --disable- crypto-auth --without-gnutls --without-ssl --without-zlib --without- libssh2 --disable-ipv6 --disable-manual --disable-telnet --disable- tftp --disable-ldap --disable-file --disable-ftp" ------------------- end of bash script file ------------------- right. save that as a script file somewhere, then 'source' it into your current shell. then you do something like this: $ source <location of that script> $ $CONFIGURE $ make install-exec and your done. I reckon your problem was that you'd CONFIGURED properly, but since you hadn't exported the env vars for C and CXX settings, the compile took place as normal. On Feb 6, 6:44 pm, youdonotex...@gmail.com wrote: > I'm attempting to configure and compile a static library for GPBs for > the iPhone. > > It seems that every library I create ends up working great in the > Simulator (Intel platform), but gets linker errors when I compile for > the Device (ARM platform). The errors all come in the form: > > "google::protobuf::UnknownFieldSet::UnknownFieldSet()", referenced > from:" followed by the .o files the function is referenced in. > > I'm using the following configure options: > > ./configure --host=arm-apple-darwin --program-prefix=iphone --disable- > shared --disable-crypto-auth --without-gnutls --without-ssl --without- > zlib --without-libssh2 --disable-ipv6 --disable-manual --disable- > telnet --disable-tftp --disable-ldap --disable-file --disable-ftp CC=/ > Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple- > darwin9-g++-4.0.1 CFLAGS="-arch armv6 -pipe -std=c99 -Wno-trigraphs - > fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable - > fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=2.0 - > gdwarf-2 -mthumb -I/Library/iPhone/include -isysroot /Developer/ > Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk" 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 > > When I run 'file libprotobuf.a', I get the message 'Current ar > archive'. Does this mean it's an ARM library? > > Any help would be greatly appreciated. > > Thanks, > Mike --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~----------~----~----~----~------~----~------~--~---