Boost.Thread Linking - boost_thread vs. boost_thread-mt

前端 未结 2 555
隐瞒了意图╮
隐瞒了意图╮ 2020-12-10 01:24

It\'s not clear to me what linking options exist for the Boost.Thread 1.34.1 library. I\'m on Ubuntu 8.04 and I\'ve found that when using either boost_thread o

相关标签:
2条回答
  • 2020-12-10 01:39

    For a detailed reference of boost library naming scheme, see: http://www.boost.org/doc/libs/release/more/getting_started/unix-variants.html#library-naming

    0 讨论(0)
  • 2020-12-10 01:41

    Well...

    The first amusing thing is that the -mt modifier in the name is to indicate the library is Ok for multithreading. Which could lead us to believe that boost_thread (without this modifier) could be multithread-unsafe...

    But the real thing is that (as seen on my own Ubuntu 10.04 box), boost_thread is a soft link to boost_thread-mt, which means the two are one and the same.

    If you want to verify it, you can open a console on your ubuntu (make the console fullscreen because the names are long), then type:

    cd /usr/lib
    

    to move to the directory where the Boost libraries are. And then:

    ls -l ./libboost_thread*
    

    Which will list all the files starting with libboost_thread, with additionnal information. The result will be something like:

    [...] ./libboost_thread.a
    [...] ./libboost_thread-mt.a -> libboost_thread.a
    

    As you can see, libboost_thread.a is a static library, and libboost_thread-mt.a is a soft link to libboost_thread.a

    0 讨论(0)
提交回复
热议问题