boost vs libboost naming problem with bjam compile for vc90

I am a first time boost user and I am interested in playing with some of the
regex features. I am forced to compile boost from svn because I'm using ms
visual c++ 9.0. I looked into this process and it appears that no
modifications are necessary for a successful compilation.
With bjam.exe in the boost root directory I execute the following command to
compile:
bjam.exe -toolset=msvc debug stage
The compilation completes without any errors and all expected lib and dlls
are present in $BOOST_ROOT\stage\lib as expected.
I then setup a simple regex project to test things out:
#include "stdafx.h"
#include

Phelps Williams wrote:
I am a first time boost user and I am interested in playing with some of the regex features. I am forced to compile boost from svn because I'm using ms visual c++ 9.0. I looked into this process and it appears that no modifications are necessary for a successful compilation.
With bjam.exe in the boost root directory I execute the following command to compile:
bjam.exe -toolset=msvc debug stage
The compilation completes without any errors and all expected lib and dlls are present in $BOOST_ROOT\stage\lib as expected. I then setup a simple regex project to test things out:
#include "stdafx.h" #include
#include <iostream> #include <string> int main() { std::string line; boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );
while (std::cin) { std::getline(std::cin, line); boost::smatch matches; if (boost::regex_match(line, matches, pat)) std::cout << matches[2] << std::endl; } }
Additionally, I have configured my boost root directory as an Additional Include Directory under Properties -> C/C++ -> General I have also configured my compiled libraries under (Properties -> Linker -> General) Additional Library Directories to the location where the compiled libs were placed. $BOOST_ROOT\stage\lib
During compilation of this project I receive link errors: LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc90-mt-gd-1 _35.lib'
So, it's trying to link to a static library.
The confusing part is in the stage\lib directory all the libs are titled in the following format "boost_libname_vc90-mt-gd.lib" or ".dll" For some reason the libraries are missing the *lib* in front of the name...for example "libboost_regex-vc90-mt-gd-1_35.lib"
Those are dynamic link libraries and import libraries corresponding to them.
I tried to rename this boost_regex example to libboost_regex but I ran into runtime exceptions. Specifically that "boost_regex-vc90-mt-gd-1_35.dll" was not found.
Right, because you are linking to import library, not a static library.
I then copied this dll into the Debug folder where the compiled exe is being executed from and everything executed properly.
Why are the static libraries not named properly? Thanks
I think you should define BOOST_ALL_DYN_LINK when building you application, to inform autolink to use dynamic libraries. - Volodya

Phelps Williams wrote:
During compilation of this project I receive link errors: LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc90-mt-gd-1 _35.lib'
You'll need to build with bjam link=static, *or* add BOOST_REGEX_DYN_LIB to the list of project defines for your VC project. And yes, I know we need to fix this before release! John.

John Maddock wrote:
Phelps Williams wrote:
During compilation of this project I receive link errors: LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc90-mt-gd-1 _35.lib'
You'll need to build with bjam link=static, *or* add BOOST_REGEX_DYN_LIB to the list of project defines for your VC project. And yes, I know we need to fix this before release!
What do we need to fix? -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org (msn) - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim,yahoo,skype,efnet,gmail

Rene Rivera wrote:
John Maddock wrote:
Phelps Williams wrote:
During compilation of this project I receive link errors: LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc90-mt-gd-1 _35.lib'
You'll need to build with bjam link=static, *or* add BOOST_REGEX_DYN_LIB to the list of project defines for your VC project. And yes, I know we need to fix this before release!
What do we need to fix?
We've discussed this before: bbv2 has been changed to build only one variant (the dll release version) by default, consequently we're going to get lots of "where the heck are the libraries" messages from VC users :-( John.
participants (4)
-
John Maddock
-
Phelps Williams
-
Rene Rivera
-
Vladimir Prus