/usr/bin/ld: skipping incompatible foo.so when searching for foo

68,161

remove -m32 in command line flags

to build with 32bit binary, you have to install

sudo apt-get install gcc-multilib and sudo apt-get install ia32-libs-dev

Share:
68,161

Related videos on Youtube

Admin
Author by

Admin

Updated on April 30, 2020

Comments

  • Admin
    Admin about 4 years

    I am using Ubuntu 13.10 64bit and I am getting the following errors while compiling the python wrappers of vlfeat library.

    g++ -o _vlfeat.so ../../vl/aib.o ../../vl/generic.o ../../vl/hikmeans.o ../../vl/ikmeans.o ../../vl/imopv.o ../../vl/mathop.o ../../vl/pgm.o ../../vl/rodrigues.o ../../vl/stringop.o ../../vl/getopt_long.o ../../vl/host.o ../../vl/imop.o ../../vl/imopv_sse2.o ../../vl/mser.o ../../vl/random.o ../../vl/sift.o ../../vl/dsift.o mser/vl_erfill.o mser/vl_mser.o sift/vl_sift.o sift/vl_dsift.o sift/vl_siftdescriptor.o imop/vl_imsmooth.o misc/vl_binsum.o kmeans/vl_hikmeans.o kmeans/vl_ikmeans.o kmeans/vl_hikmeanspush.o kmeans/vl_ikmeanspush.o py_vlfeat.o -m64 -msse -m32 -msse -shared  -lboost_python-mt-py27
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../libboost_python-mt-py27.so when searching for -lboost_python-mt-py27
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../libboost_python-mt-py27.a when searching for -lboost_python-mt-py27
    /usr/bin/ld: skipping incompatible /usr/lib/libboost_python-mt-py27.so when searching for -lboost_python-mt-py27
    /usr/bin/ld: skipping incompatible /usr/lib/libboost_python-mt-py27.a when searching for -lboost_python-mt-py27
    /usr/bin/ld: cannot find -lboost_python-mt-py27
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so when searching for -lstdc++
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a when searching for -lstdc++
    /usr/bin/ld: cannot find -lstdc++
    /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.so when searching for -lm
    /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.a when searching for -lm
    /usr/bin/ld: cannot find -lm
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
    /usr/bin/ld: cannot find -lgcc_s
    /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
    /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.a when searching for -lc
    /usr/bin/ld: cannot find -lc
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
    /usr/bin/ld: cannot find -lgcc_s
    collect2: error: ld returned 1 exit status
    make: *** [_vlfeat.so] Error 1
    

    Any solutions to make this library work on 64 bit architecture?

    • Markku K.
      Markku K. about 11 years
      you have both -m32 and -m64 specified ... which one do you want?
    • Admin
      Admin about 11 years
      I am not sure what they stand for as I am a noob to C++. Can you explain a bit on that? FYI, I am using 64 bit Ubuntu.
    • Markku K.
      Markku K. about 11 years
      -m32 generates 32-bit code, and -m64 generates 64-bit code (this should be the default on your system). You should only specify one of them, if any. You can run either 32-bit or 64-bit executables on your system, but a 32-bit executable links with 32-bit libraries and a 64-bit executable links with 64-bit libraries. Did you compile source code to generate the .o files, or did they come from somewhere else?
    • Admin
      Admin about 11 years
      @MarkkuK. Here is the README of the library I am trying to install github.com/mmmikael/vlfeat/tree/python-wrappers/python
    • Admin
      Admin about 11 years
      @MarkkuK. The .o files are the result of compilation of ../../vl in the above repository
    • Markku K.
      Markku K. about 11 years
      Did you change anything in the makefile? Did you just invoke make, and then you got the above error?
    • Admin
      Admin about 11 years
      @MarkkuK. I made the following two changes in the makefile github.com/mmmikael/vlfeat/blob/python-wrappers/python/vlfea‌​t/… 1)Line 46 : Replaced python2.5 with python2.7 2)Line 75 : Replaced ....mt-py25 with ....mt-py27
    • Markku K.
      Markku K. about 11 years
      Well, I don't know anything about that library or the code, but you could try removing the -m32 from LDFLAGS. You should then make clean, followed by make.
    • Admin
      Admin about 11 years
      @MarkkuK. : Thanks a lot. I will try this out and will let you know the outcome.
    • Admin
      Admin about 11 years
      @MarkkuK. : I did as you said and it seemed to have solved the problem but I am now getting a different error which seems to me unrelated to the previous error. Can you confirm this. Also please comment if you know anything about the new error. Here is the log : pastebin.com/KAqrgEmn
    • kirbyfan64sos
      kirbyfan64sos over 10 years
      @Ankit: Did you try what the error said? i.e. go through the Makefile add shove -fPIC on each target>
  • Fennekin
    Fennekin almost 9 years
    "sudo apt-get install gcc-multilib" thats an linux hack. Is there such hack for windows ? (stuck with same linking problem on windows 7)
  • user
    user over 8 years
    E: Package 'ia32-libs-dev' has no installation candidate
  • jitter
    jitter over 7 years
    sudo apt-get install gcc-multilib fixes the issue on debian jessie for me.
  • Michael Firth
    Michael Firth almost 4 years
    If what you are building includes any C++ parts, there is also a g++-multilib package that will be needed - so on Ubuntu 16.04, I needed 'sudo apt-get install gcc-multilib g++-multilib".
  • Mohammad Rahimi
    Mohammad Rahimi over 3 years
    I'm cross compiling qt for raspberry pi. I'm using arm-linux-gnueabihf- which I have installed with sudo apt install crossbuild-essential-armhf. your answer helped me to build QtWebEngine with using this command sudo apt-get install lib32z1-dev because I didn't have 32 bit zlib.