24

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?

  • 7
    you have both `-m32` and `-m64` specified ... which one do you want? – Markku K. Jun 04 '13 at 21:41
  • 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. –  Jun 04 '13 at 21:48
  • 1
    `-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? – Markku K. Jun 04 '13 at 22:00
  • @MarkkuK. Here is the README of the library I am trying to install https://github.com/mmmikael/vlfeat/tree/python-wrappers/python –  Jun 04 '13 at 22:41
  • @MarkkuK. The .o files are the result of compilation of ../../vl in the above repository –  Jun 04 '13 at 22:45
  • Did you change anything in the makefile? Did you just invoke `make`, and then you got the above error? – Markku K. Jun 04 '13 at 23:03
  • @MarkkuK. I made the following two changes in the makefile https://github.com/mmmikael/vlfeat/blob/python-wrappers/python/vlfeat/Makefile 1)Line 46 : Replaced python2.5 with python2.7 2)Line 75 : Replaced ....mt-py25 with ....mt-py27 –  Jun 04 '13 at 23:12
  • 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`. – Markku K. Jun 04 '13 at 23:17
  • @MarkkuK. : Thanks a lot. I will try this out and will let you know the outcome. –  Jun 04 '13 at 23:28
  • @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 : http://pastebin.com/KAqrgEmn –  Jun 04 '13 at 23:37
  • @Ankit: Did you try what the error said? i.e. go through the Makefile add shove -fPIC on each target> – kirbyfan64sos Oct 29 '13 at 01:16

1 Answers1

16

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

D3Hunter
  • 1,329
  • 10
  • 21
  • *"sudo apt-get install gcc-multilib"* thats an linux hack. Is there such hack for windows ? (stuck with same linking problem on windows 7) – Fennekin Sep 27 '15 at 15:16
  • 4
    `E: Package 'ia32-libs-dev' has no installation candidate` – user Oct 06 '15 at 19:23
  • `sudo apt-get install gcc-multilib` fixes the issue on debian jessie for me. – jitter Jan 07 '17 at 03:05
  • 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". – Michael Firth Aug 21 '20 at 10:30
  • 1
    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. – Mohammad Rahimi Dec 05 '20 at 06:52