Build with Boost via Visual Studio doesn't let you select the correct VS version or statically linked libraries

#include <boost/regex.hpp>

int main(void)
{
    return 0;
}

      

Error 2 fatal error LNK1104: unable to open file 'libboost_regex-vc90-mt-gd-1_38.lib'

It's not a problem. I intentionally don't have the .lib built and want to link the mt-sgd-1_38.lib file, but I don't know what I need to set up auto-naming, select mt-sgd instead of mt -GD.

Also, I'm not sure how it detects using vc90, but I'm trying to build with VS 2005 which is vc80.

0


a source to share


3 answers


I believe the flag ('s') indicates static binding; i.e.: statically link the c-runtime libraries. This will be the project setup for your application.



Also, for the v80 / v90 issue, I had a similar thing when I had the v90 compiler installed with some part of the platform SDK. If you get v90 in the linker object name, chances are you are actually building the v90 compiler (which is possible in the 2005 IDE, depending on your path settings and what is installed). It shouldn't be a problem if everything fits.

+1


a source


Try adding BOOST_LIB_DIAGNOSTIC to the preprocessor, I used this earlier to spot problems like I usually had the opposite problem. It tries statically and I want dynamic, I fixed it one last time by adding BOOST_THREAD_USE_DLL, there must be other equivalents - I assume you just replace THREAD with the name of the library you are using.



0


a source


This option worked for me when creating: runtime-link = static as in

.\b2 runtime-link=static

      

0


a source







All Articles