Question

I am using XCode 3.2 and have installed boost using the MacPorts project (both release and debug) however I am at a loss to get my application to link with boost::filesystem

I have set my library search path to /opt/local/lib but I still get unresolved references when linking the project.

I noticed in another post to add -lboost_system to the "other linker flags" but when I do this I get - libboost_system.dylib, file was built for unsupported file format which is not the architecture being linked (i386).

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

Martin

Était-ce utile?

La solution

You didn't indicate what OS version you are build it with. My guess is MacPort defaults to x64 when building and installing ports. Uninstall boost from MacPort then re-install it with universal variant.

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

Autres conseils

It is possible that the name of the library is not exactly boost_system but maybe boost_system-mt (the -mt is because boost was compiled with thread safety) or even some other suffix.

To be sure, you can look up the name in /opt/local/lib:

find /opt/local/lib -name "libboost_system*"
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top