Не удается найти библиотеку boost-thread-mt
Я собираю программу, которая требует библиотеки boost-thread-mt. Я установил libboost-all-dev, используя sudo apt-get install libboost-all-dev
но компилятор говорит, что не может найти библиотеку boost-thread-mt. Эта библиотека в каком-то другом пакете? Пожалуйста, направьте меня, что мне нужно для этого установить.
3 ответа
-mt
суффикс был удален. Установленные библиотеки Boost являются многопоточными.
Вы можете скомпилировать вашу программу против libboost-thread
, Либо путем изменения источника, чтобы использовать не -mt
libs или делая символические ссылки libboost_thread.a
→libboost_thread-mt.a
, То же самое, если вам нужны общие библиотеки .so
,
Эта ссылка связана с этим вопросом.
Вы также можете попробовать скомпилировать boost из исходного кода, а не использовать версию apt-get.
Аргументы --layout
, threading
а также build-type
поможет.
--layout=<layout> Determines whether to choose library names
and header locations such that multiple
versions of Boost or multiple compilers can
be used on the same system.
versioned - Names of boost binaries
include the Boost version number, name and
version of the compiler and encoded build
properties. Boost headers are installed in a
subdirectory of <HDRDIR> whose name contains
the Boost version number.
tagged -- Names of boost binaries include the
encoded build properties such as variant and
threading, but do not including compiler name
and version, or Boost version. This option is
useful if you build several variants of Boost,
using the same compiler.
system - Binaries names do not include the
Boost version number or the name and version
number of the compiler. Boost headers are
installed directly into <HDRDIR>. This option
is intended for system integrators who are
building distribution packages.
The default value is 'versioned' on Windows, and
'system' on Unix.
Итак, попробуйте эту команду, чтобы установить boost, после bootstrap.sh --prefix=/path/of/yours
:
./b2 install -j16 threading=multi --layout=tagged --build-type=complete
Тогда вы получите все -mt
библиотеки.
Если ваш проект использует CMake
этот следующий переключатель в модуле FindBoost должен быть отключен: -DBoost_USE_MULTITHREADED=OFF