Marvee Amasi
Marvee Amasi
DIIDevHeads IoT Integration Server
Created by Marvee Amasi on 8/30/2024 in #middleware-and-os
Issues with Boost Library for x86_32 Architecture on Ubuntu 22.04 – How to Manage Conflicts with x86
I'm working on a C++ project that uses the Boost program_options library on Ubuntu 22.04 system with an Intel Core i7 processor. I've successfully compiled and run the project for x86_64 architecture using the following command:
g++ program.cpp -m64 -static -lboost_program_options -o compiled/program.out
g++ program.cpp -m64 -static -lboost_program_options -o compiled/program.out
So when I try to compile for x86_32 architecture using -m32, I encounter the following error:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../libboost_program_options.a when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible /usr/lib/libboost_program_options.a when searching for -lboost_program_options
/usr/bin/ld: cannot find -lboost_program_options
collect2: error: ld returned 1 exit status
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../libboost_program_options.a when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible /usr/lib/libboost_program_options.a when searching for -lboost_program_options
/usr/bin/ld: cannot find -lboost_program_options
collect2: error: ld returned 1 exit status
I've attempted to install the 32-bit Boost library using
sudo apt-get install libboost_program_options-dev:i386
sudo apt-get install libboost_program_options-dev:i386
but it conflicts with the 64-bit version. How can I effectively manage Boost library installations for both x86 and x86_64 architectures on the same system? Are there any alternative approaches or workarounds to avoid conflicts and ensure compatibility?
7 replies