0

i have downoaded the wunder radio project, i have copy the MMS project in my workspace. if i try to use mms_connect Xcode4 give me this error:

Ld /Users/Alex/Library/Developer/Xcode/DerivedData/test1-gevnovbiecnctxguaabsznvdybxa/Build/Products/Debug-iphonesimulator/test1.app/test1 normal i386 cd /Users/Alex/Source/test1 setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/Alex/Library/Developer/Xcode/DerivedData/test1-gevnovbiecnctxguaabsznvdybxa/Build/Products/Debug-iphonesimulator -F/Users/Alex/Library/Developer/Xcode/DerivedData/test1-gevnovbiecnctxguaabsznvdybxa/Build/Products/Debug-iphonesimulator -filelist /Users/Alex/Library/Developer/Xcode/DerivedData/test1-gevnovbiecnctxguaabsznvdybxa/Build/Intermediates/test1.build/Debug-iphonesimulator/test1.build/Objects-normal/i386/test1.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lz.1 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/Alex/Library/Developer/Xcode/DerivedData/test1-gevnovbiecnctxguaabsznvdybxa/Build/Products/Debug-iphonesimulator/test1.app/test1

Undefined symbols for architecture i386: "_mms_connect", referenced from: -[test1AppDelegate application:didFinishLaunchingWithOptions:] in test1AppDelegate.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status

have any idea to resolve it?

1 Answers1

0

It looks like the linker is failing to link to libmms because it is of the wrong architecture. The project you are building appears to be for the iPhone simulator. Since the simulator runs on your computer it's architecture is i386 (or perhaps x86_64 depending upon the machine you are using). So basically you are compiling using i386 but when the linker tried to link to libmms it did not find that libmms had been compiled using the same architecture.

Since iOS devices use armv6 or armv7 architectures and the simulator uses i386, it can be quite difficult to switch back and forth between building for the actual device or building for the simulator since any external static libraries need to be built for all 3 architectures.

You'll likely need to rebuild libmms using the i386 architecture.

Carter
  • 4,738
  • 2
  • 22
  • 24
  • on the Architecture option there isn't i386! there is only "Standard (armv6 armv7)" or "Optimize (armv7)" how i compile it in i386 arc? – The Psicopath Oct 01 '11 at 11:56
  • If you download the library and follow the instructions for building it on your local machine you should end up with a i386 or x86_64 binary (each of which would suitable if you are running a modern Mac). – Carter Oct 09 '11 at 12:54
  • Also forgot to mention that when you compile the library for all 3 architectures you will end up with 3 libraries. This makes it difficult because you have to add them all to your Xcode project. An easy and elegant solution is to use "lipo", a command line tool that can combine binaries of separate architectures into a fat binary that can run on multiple. I did this for a project requiring openssl and it works great. – Carter Oct 09 '11 at 12:55