Установка 32 битных библиотек boost в ubuntu?

В общем встала задача подключить restsdk к проекту в linux для компиляции 32 битной библиотеки. Компилирую, и вот что выходит

independent@independent-W35xSS-370SS:~/workbench/ukau-gmod-module$ ./compile.sh 
/usr/bin/ld: /tmp/cc9Ec8ui.o: in function `_GLOBAL__sub_I_main.cpp':
main.cpp:(.text+0xb0): undefined reference to `boost::system::system_category()'
/usr/bin/ld: /tmp/cc9Ec8ui.o: in function `boost::system::error_category::std_category::equivalent(int, std::error_condition const&) const':
main.cpp:(.text._ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition[_ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition]+0x3b): undefined reference to `boost::system::generic_category()'
/usr/bin/ld: main.cpp:(.text._ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition[_ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition]+0xbc): undefined reference to `boost::system::generic_category()'
/usr/bin/ld: /tmp/cc9Ec8ui.o: in function `boost::system::error_category::std_category::equivalent(std::error_code const&, int) const':
main.cpp:(.text._ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei[_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei]+0x3f): undefined reference to `boost::system::generic_category()'
/usr/bin/ld: main.cpp:(.text._ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei[_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei]+0xc0): undefined reference to `boost::system::generic_category()'
/usr/bin/ld: main.cpp:(.text._ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei[_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei]+0xfc): undefined reference to `boost::system::generic_category()'
/usr/bin/ld: /tmp/cc9Ec8ui.o: in function `std::_Sp_counted_ptr<boost::asio::ssl::detail::openssl_init_base::do_init*, (__gnu_cxx::_Lock_policy)2>::_M_dispose()':
main.cpp:(.text._ZNSt15_Sp_counted_ptrIPN5boost4asio3ssl6detail17openssl_init_base7do_initELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv[_ZNSt15_Sp_counted_ptrIPN5boost4asio3ssl6detail17openssl_init_base7do_initELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv]+0x21): undefined reference to `CONF_modules_unload'
/usr/bin/ld: /tmp/cc9Ec8ui.o: in function `boost::asio::detail::posix_global_impl<boost::asio::system_context>::~posix_global_impl()':
main.cpp:(.text._ZN5boost4asio6detail17posix_global_implINS0_14system_contextEED2Ev[_ZN5boost4asio6detail17posix_global_implINS0_14system_contextEED5Ev]+0x208): undefined reference to `pthread_join'
/usr/bin/ld: main.cpp:(.text._ZN5boost4asio6detail17posix_global_implINS0_14system_contextEED2Ev[_ZN5boost4asio6detail17posix_global_implINS0_14system_contextEED5Ev]+0x21e): undefined reference to `pthread_detach'
/usr/bin/ld: /tmp/cc9Ec8ui.o: in function `boost::asio::ssl::detail::openssl_init_base::instance()':
main.cpp:(.text._ZN5boost4asio3ssl6detail17openssl_init_base8instanceEv[_ZN5boost4asio3ssl6detail17openssl_init_base8instanceEv]+0x103): undefined reference to `CONF_modules_unload'
/usr/bin/ld: /tmp/cc9Ec8ui.o: in function `boost::asio::error::detail::ssl_category::message[abi:cxx11](int) const':
main.cpp:(.text._ZNK5boost4asio5error6detail12ssl_category7messageB5cxx11Ei[_ZNK5boost4asio5error6detail12ssl_category7messageB5cxx11Ei]+0x1b): undefined reference to `ERR_reason_error_string'
collect2: error: ld returned 1 exit status


Получается что он не находит библиотеки, ладно. Подключаю библиотеку с помощью -lboost_system и на выходе получается
independent@independent-W35xSS-370SS:~/workbench/ukau-gmod-module$ ./compile.sh 
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libboost_system.so when searching for -lboost_system
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libboost_system.a when searching for -lboost_system
/usr/bin/ld: cannot find -lboost_system
collect2: error: ld returned 1 exit status

Я так понял что библиотеки 64 битные. Подскажите, как исправить ситуацию?
  • Вопрос задан
  • 389 просмотров
Пригласить эксперта
Ответы на вопрос 2
Radjah
@Radjah
Добавить архитектуру i386.
sudo dpkg --add-architecture i386
Поставить пакет libboost-all-dev:i386 или только нужные dev с указанием архитектуры.
Скорее всего понадобится еще пакет gcc-multilib.

Добавь в параметры запуска компилятора флаг -m32

Раз https://www.geeksforgeeks.org/compile-32-bit-progr...
Два https://stackoverflow.com/questions/1272357/how-to...
Ответ написан
Комментировать
shambler81
@shambler81 Куратор тега Linux
Вы не указали дистрибутив.
но вот давно говорили
https://ko.com.ua/razrabotchiki_linux_otkazyvayuts...
А вот уже следствия
https://www.opennet.ru/opennews/art.shtml?num=50935
Возможно вы счастливый обладатель ;)
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы