Boost logo

Boost Users :

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


Bobby Ward wrote:
> Fortunately/Unfortunately you have to specify the library as
>
> -lboost_regex-mgw41-1_34

Hoo-ray, it finally works. Thanks very much for this crucial information.
FWIW, use of the LIBRARY_PATH environment variable works, too, so my successful
command line looks like this:

D:\Temp>g++ -Wall -O3 -ID:\C++\Boost\Current -o boostbuildtest.exe
boostbuildtest.cpp -lboost_regex-mgw41-1_34 -lboost_filesystem-mg
w41-1_34

While trying to resolve this issue, I noticed during my search of the Boost User
newsgroup that I was only one of several people having difficulty getting Boost
to link with gcc, especially because, IIUC, things changed from 1.33 to 1.34.
Better documentation would help. For example,
http://www.boost.org/more/getting_started/windows.html says "On Windows, append
a version number even if you only have one version installed (unless you are
using the msvc or gcc toolsets, which have special version detection code) or
auto-linking will fail." This strongly suggests that gcc supports auto-linking
in a manner similar to MSVC, so I was surprised that what worked for MSVC did
not work for gcc. Later on that page I read "Most Windows compilers and linkers
have so-called “auto-linking support," and since g++ is commonly used on
Windows, I assumed that it fell into the "Most Windows compilers" category.

It would be nice if that page didn't limit its examples to MSVC. I know it's
not practical to cover all possible compilers, but it seems to me that the big
two are VC++ and gcc, so it'd be nice to have examples using both front and center.

Thanks for all for your help.

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