Linking Boost Filesystem in XCode 3.2 (MacPorts)

I am using XCode 3.2 and install boost using the MacPorts project (both for release and debug) but I am not able to get my app to link to boost :: filesystem

I set the library search path to / opt / local / lib, but I still get unresolved links when linking the project.

I noticed in another post to add -lboost_system to "other linker flags", but when I do that I got - libboost_system.dylib, the file was generated for an unsupported file format that is not architecture related (i386).

Is MacPorts not installing the correct libraries or am I missing something else?

Martin

+3


source to share


2 answers


You didn't mention which OS version you are building. I assume MacPort is x64 by default when building and installing ports. Uninstall increase from MacPort, then reinstall it using generic variant .



%% sudo port uninstall boost
%% sudo port install boost +universal

      

+5


source


It is possible that the name of the library is not accurate boost_system

, but maybe boost_system-mt

( -mt

- this is because boost was compiled with thread safety) or even some other suffix.

You can of course find the name in /opt/local/lib

:



find /opt/local/lib -name "libboost_system*"

      

+1


source







All Articles