Problems using a library in Xcode

Posted by Pablo on Stack Overflow See other posts from Stack Overflow or by Pablo
Published on 2010-06-02T06:38:10Z Indexed on 2010/06/02 6:43 UTC
Read the original article Hit count: 391

Filed under:
|
|
|

Hi!

I'm actually developping an application for iPhone and I need to use a library, initially dedicated to a Linux environment. Since I'm using a Mac (with Snow Leopard and Intel Core Duo), I guess it's possible to use this library in my app.

My library has 3 files: a file .h, a file .a and a file .so (both .a and .so are in /Developer/usr/lib). In addition I have included the .h i nmy code and I've added the .a in XCode has a framework (and it works because XCode find the .so compiling).

For your info when I use the command "file" for the file .so, I have: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

When I compile for the Xcode Simulator, I have a warning and an error.
The warning is:
In /Developer/usr/lib/mylib.so, file was built for unsupported file format which is not the architecture being linked (i386)

The error is: "_mylib_fct", referenced from:
-[MyAppAppDelegate applicationDidBecomeActive:] in MyAppAppDelegate.o
Symbol(s) not found
Collect2: ld returned 1 exit status

When I compile for the Device 3.0 with architecture arm6, I also have the same error, but the warning is quite different:
ln /Users/Pablo/MyApp/mylib.a file is not of required architecture

I try to solve this and make the app working with this lib since days, and I don't understand why the compiler is complaining... is it a 32/64 bits issues ? How can I deal with that ?

Your help will be very appreciated. Thx!

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about xcode