Do i have static or dynamic boost libraries?

后端 未结 5 2043
长情又很酷
长情又很酷 2020-12-08 17:04

I have ran bjam.exe --build-dir=\"C:\\build-boost\" --build-type=minimal msvc stage

and now I have libraries .lib with these headers, for example

<
5条回答
  •  囚心锁ツ
    2020-12-08 17:51

    here is how i break it down

    libboost_serialization-vc100-mt-sgd-1_45.lib

    lib- if boost library starts with lib then its a static library , shared library do not start with lib prefix. Also static library will have a '-s' in the name.
    
    mt- multi-threaded , obtained by specifying threading=multi when you ran bjam or b2.This is the default threading.
    
    g- use debug libraries for building the code
    d- build a debug version of your code
    

    So your compiler is searching for multi-threaded static debug library(mt-sgd) as you ran with /MTd(Creates a debug multithreaded executable file using LIBCMTD.lib). I guess by default it must be searching for static library. If you want a dynamic library, insert these lines in your code or define a macro

    #define BOOST_ALL_DYN_LINK
    

提交回复
热议问题