In the boost, there are two types of libs, one is ending with mt-gd
, the other is ending with mt-s
. What's the difference between those two?
Asked
Active
Viewed 2.8k times
38

Trevor Hickey
- 36,288
- 32
- 162
- 271

user705414
- 20,472
- 39
- 112
- 155
2 Answers
56
Read Boost Getting Started on Windows
- mt : multi threaded
- d : Add ABI tags, could be used with:
- g : using debug versions of the standard and runtime support libraries.
- s : linking statically to the standard and runtime support libraries.
- and more
-
12When building in windows using .\b2, it builds the mt and mt-g libraries by default. To build mt-s libraries, use `.\b2 runtime-link=static`. The libraries are created in the 'stage' directory rather than the 'libs' directory by default. – Soma Holiday Jan 06 '16 at 22:59
20
As pointed out in the other answers and comments, these represent different configurations. With this answer, I'd like to give a more complete overview and link to the corresponding Visual Studio configurations:
- Boost's
-mt-s
corresponds to VS' Runtime Library setting/MT
- Boost's
-mt-sgd
corresponds to VS' Runtime Library setting/MTd
- Boost's
-mt
corresponds to VS' Runtime Library setting/MD
- Boost's
-mt-gd
corresponds to VS' Runtime Library setting/MDd
First and second can be built with ./b2 runtime-link=static threading=multi
Third and fourth can be built with ./b2 runtime-link=shared threading=multi

j00hi
- 5,420
- 3
- 45
- 82