开发者

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

开发者 https://www.devze.com 2023-04-06 19:06 出处:网络
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 kno开发者_高级运维w how

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 kno开发者_高级运维w 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消