Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost libs building - difference between runtime-link and link options

Tags:

I'm trying to build boost libraries in Windows 7 with MSVC (VS 2010).

I have come across the options runtime-link and link in the bjam command line options. I would like to know how they are used and what is the exact difference between them.

I have built the Boost Regex library using this command line

bjam --with-regex variant=release --build-options=complete

it produced these files:

1)boost_regex-vc100-mt-1_47.dll (Import library:boost_regex-vc100-mt-1_47.lib)

2)libboost_regex-vc100-mt-1_47.lib

3)libboost_regex-vc100-mt-s-1_47.lib

4)libboost_regex-vc100-s-1_47.lib

What is the difference between 2 and 3 .lib files? Both of them are static libs. I have gone through the Boost doc but didn't find much explanation in that.

TIA

like image 380
Anvesh Avatar asked Sep 22 '11 00:09

Anvesh


1 Answers

runtime-link refers to how your compiler's runtime is linked. That is, it corresponds to VC's Multithreaded vs. Multithreaded DLL option. Runtime means the components required for using the standard libraries available with your compiler.

You have probably seen the dynamic link files at some point: MSVCRTXX.DLL (C runtime) and MSVCPXX.DLL (C++ standard library), MFCXX.DLL (MFC core classes). The static counterparts are LIBC and LICBP (see here for the library table)

The runtime-link option you use when building Boost should match the option when you're using for your client code. Otherwise you'll get errors due to mismatched runtime either at link time or upon running your program.

When building your program to use the dynamic link runtime, you need to include the VC redistributable when deploying your application.

link refers to how the boost library your building will be linked to, either as a static or dynamic link library.

like image 124
Pablo Avatar answered Oct 23 '22 05:10

Pablo