Problems with linking to Boost dylibs in Xcode

Discussion in 'Mac Programming' started by TastyCocoa, Aug 16, 2012.

  1. TastyCocoa macrumors newbie

    TastyCocoa

    Joined:
    Mar 21, 2011
    #1
    Tldr
    Boost dylibs are not linking to my xcode project properly. I have no idea why.



    I realise this is something of a problem on the internet, but after 45 minutes of googling I haven't found a solution to my problem.

    Okay - so I'm trying to link in the boost filesystem library to my Xcode 4.1 project. So far I've unpacked and installed the boost libraries, and linked to them through my header and search paths in xcodes build settings.

    So, if I try to compile the program at this point I get linker errors, cannot find boost etc. Linking to the static boost libraries (for example boost::rand) works fine. So it must be the dynamic libraries that are the problem.

    If I drag and drop the dylibs from the boost install directory into the build phases box the project compiles fine, but I get symbol errors when I run the program (which I have gleaned means that there are still linker errors).

    Any help anyone can provide would be really appreciated.
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    Post the complete text of all error messages.

    What OS version are you using?

    Have you tried finding and building a known-good program that uses Boost? Anything open-source that actually works should suffice.
     
  3. TastyCocoa thread starter macrumors newbie

    TastyCocoa

    Joined:
    Mar 21, 2011
    #3
    I should have mentioned that what I'm trying to compile is the first boost::filesystem example off the boost website

    The error messages I get when I run the program are
    warning: Unable to read symbols for libboost_filesystem.dylib (file not found).
    warning: Unable to read symbols from "libboost_filesystem.dylib" (not yet mapped into memory).
    warning: Unable to read symbols for libboost_system.dylib (file not found).
    warning: Unable to read symbols from "libboost_system.dylib" (not yet mapped into memory).

    I've got the whole thing working through the command line and with a makefile (after figuring out that I need to set an appropriate DYLD_LIBRARY_PATH variable), but getting it working in XCode is still eluding me.
     

Share This Page