0

I have a C++ Program which needs the program_options library from the libboost package.

I installed boost with sudo apt-get install libboost1.54-all-dev and then i compiled my program with

g++ program.cpp -m64 -static -lboost_program_options -o compiled/program.out.

Everything worked fine.

Then i wanted to compile it for 32bit so i used -m32 instead of -m64.

It said:

/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

Then i used Google and i found, that i have to install the boost i386 package for compiling i386 applications. But it seems, that i cant install amd64 and i386 the same time. When i try to install i386 apt-get want to remove the amd64 packages and when i try amd64 then i386 will be removed.

I can compile my apps in i386, but i have to install i386 and then reinstall amd64...

Hope anyone can help me with this! Thankyou!

fusionlightcat
  • 365
  • 1
  • 5
  • 20
  • Use version 1.55, the 386 and amd64 versions can now be installed together (at least on debian, you didn't specify your OS), if you install per package: not the -all one, but libboost-program-options1.55-dev for instance. – Marc Glisse Jun 09 '14 at 17:48
  • ah yes i am on debian thx for the tip, ill check it out... – fusionlightcat Jun 09 '14 at 17:52
  • hmm. it isnt looking like the 1.55 versions are in my repo... i am using debian jessie on linux mint debian edition... – fusionlightcat Jun 09 '14 at 17:54
  • 1.55 is available in debian testing and unstable (I don't know anything about mint). – Marc Glisse Jun 09 '14 at 17:55
  • mint is based on debian testing... can u give me the exact package name? – fusionlightcat Jun 10 '14 at 10:23
  • ah okay i added the official debian repository testing to my sources.list... now i installed libboost-dev-all:amd64 and it works fine and it was 1.55. but when i try to install the same package for i386 following error comes: – fusionlightcat Jun 10 '14 at 10:57
  • libboost-all-dev:i386 : depends on: libboost-mpi-dev:i386 depends on: libboost-mpi-python-dev:i386 depends on: libboost-python-dev:i386 – fusionlightcat Jun 10 '14 at 10:57
  • I told you not to install the -all package but just libboost-program-options1.55-dev:i386 and libboost-program-options1.55-dev:amd64 (and similarly for others if you need them). Most boost packages are now multiarch but not all, and in particular not the python one. – Marc Glisse Jun 10 '14 at 20:35
  • omg... i removed evryting and installed the libboost-program options1.55.... itw anted to update libc and i said yes. but then o command works after this and after a restart i got kernel panic because itc ant launch the init... i reinstalled my system and now i have a new fresh debian. so, u say i should install libboost-program-options1.55-dev:i386. okay. and the amd64 version? only this package too? – fusionlightcat Jun 11 '14 at 12:33

0 Answers0