Boost logo

Boost Users :

From: Scott Meyers (usenet_at_[hidden])
Date: 2007-05-30 01:03:38


I've built Boost 1.34 for VC8 and g++ 4.1.1 on WinXP. I'm testing my
installation with a simple program that uses Boost.FileSystem and Boost.Regex.
Compilation is no problem, and for VC8, all I have to do to get things to link
is add the location of the Boost binaries to the LIB environment variable.

I was hoping that all I had to do for g++ was do the same for the LIBRARY_PATH
environment variable (per
http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html), but I get
unresolved symbol errors during linking even after doing that. I played around
with the -l option (per
http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#Link-Options), but nothing I
tried worked.

I have the following relevant binaries in my Boost binary directory:

libboost_regex-mgw41-1_34.a
libboost_regex-mgw41-d-1_34.a
libboost_regex-mgw41-mt-1_34.a
libboost_regex-mgw41-mt-d-1_34.a
libboost_regex-mgw41-mt-s-1_34.a
libboost_regex-mgw41-mt-sd-1_34.a
libboost_regex-mgw41-s-1_34.a
libboost_regex-mgw41-sd-1_34.a
boost_filesystem-mgw41-1_34.a
boost_filesystem-mgw41-d-1_34.a
boost_filesystem-mgw41-mt-1_34.a
boost_filesystem-mgw41-mt-d-1_34.a
libboost_filesystem-mgw41-1_34.a
libboost_filesystem-mgw41-d-1_34.a
libboost_filesystem-mgw41-mt-1_34.a
libboost_filesystem-mgw41-mt-d-1_34.a
libboost_filesystem-mgw41-mt-s-1_34.a
libboost_filesystem-mgw41-mt-sd-1_34.a
libboost_filesystem-mgw41-s-1_34.a
libboost_filesystem-mgw41-sd-1_34.a

Can somebody explain or point me to an explanation of what I need to do to get a
program using Boost binaries to link? I'm hoping there's something as simple as
with VC8 where I can just specify a directory to look in and have the linker
magically figure everything out from there. I'd like to avoid explicitly having
to add a new library to link against each time I start using a new compiled
Boost library in a project.

Incidentally, in the above list of files, I notice that for Boost.FileSystem,
there are some archives that start with lib and some that do not, while for
regex, all start with lib. Is this meaningful?

Thanks,

Scott


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net