No se puede encontrar la biblioteca boost-thread-mt


8

Estoy compilando un programa que requiere la biblioteca boost-thread-mt. He instalado libboost-all-dev usando sudo apt-get install libboost-all-devpero el compilador dice que no puede encontrar la biblioteca boost-thread-mt. ¿Esta biblioteca está en algún otro paquete? Guíeme lo que necesito instalar para esto.


Tienes libboost-thread-devinstalado?
Cornelius

No hay -mtbibliotecas en el paquete Boost principal. Vea también esta pregunta sin resolver.
saiarcot895

¿Cómo puedo instalar las bibliotecas -mt?
Muhammad Omer

Respuestas:


13

El -mtsufijo había sido eliminado. Las bibliotecas Boost instaladas son seguras para subprocesos múltiples.

Puedes compilar tu programa versus libboost-thread. Cambiando la fuente para usar no -mtlibs o haciendo enlaces simbólicos libboost_thread.alibboost_thread-mt.a. Lo mismo si necesita bibliotecas compartidas .so.


2
Entonces ... ¿algún consejo sobre el desarrollo multiplataforma dado que Ubuntu en su sabiduría decidió hacer las cosas de manera diferente a los demás?
Seudónimo

@ Seudónimo, si está utilizando las herramientas automáticasAC_CHECK_LIB
user.dz

1
Autoconf es excesivo para muchos proyectos, especialmente si está utilizando Boost.Build.
Seudónimo

@ Seudónimo, no estoy tan familiarizado con boost pero check-target-builds parece ofrecer la misma funcionalidad de autoconf para boost.build.
user.dz

0

Si su proyecto usa CMake, este siguiente interruptor proporcionado en el módulo FindBoost tiene que apagarse:-DBoost_USE_MULTITHREADED=OFF


0

Este enlace está relacionado con esta pregunta.

También puede intentar compilar boost desde la fuente en lugar de usar la versión apt-get.

Los argumentos --layout, threadingy build-typeayudarán.

--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.

Entonces, intente este comando para instalar boost, después de bootstrap.sh --prefix=/path/of/yours:

./b2 install -j16 threading=multi --layout=tagged --build-type=complete

Entonces obtendrás todas las -mtbibliotecas.

Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.