4

After alot of hacking i have managed to compile the boost-libraries for iphone, both device and simulator, but when i try to use them i get an error in the xcode debugger saying:

dyld: Library not loaded: libboost_graph.so.1.40.0

which im guessing is a dynamic library loader which isn't allowed on the iphone. i'm linking the app with -Lboost_graph as a compiler flag.

this is the script i used for building boost:

./bjam $1 $2 $3 \
        toolset=darwin \
        architecture=arm \
        target-os=iphone \
        macosx-version=iphone-3.0 \
        define=_LITTLE_ENDIAN \
        --layout=system \
        --libdir=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib \
        --includedir=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include \
        link=static \
        runtime-link=static

./bjam $1 $2 $3 \
        toolset=darwin \
        architecture=x86 \
        target-os=iphone \
        macosx-version=iphonesim-3.0 \
        --layout=system \
        --libdir=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/lib \
        --includedir=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/include \
        link=static \
        runtime-link=static

I'm guessing i am missing something very basic here, but what?

is the library compiled for dynamic loading (there is both an .a-file and a .so-file in the platform /usr/lib)

possan
  • 475
  • 3
  • 15

1 Answers1

2

I might be wrong, but I think you will need to link your application statically with boost - the error message from dyld suggests that you are currently linking to the dynamic boost library (note the .so suffix in the error message - you want to be linking against the static one - libboost.a

you probably want to link your app with something like:

-iboost_graph -static

(assuming the .a file is called libboost_graph.a)

DaveR
  • 9,540
  • 3
  • 39
  • 58
  • it seems that linking with -static makes the compiler fall back to a different linker, giving another error: "ld_classic: can't locate file for: -lcrt0.o" atleast i got another compiler flag to google :) – possan Jul 12 '09 at 21:59