First time here? Check out the FAQ!

Ask Your Question
1

Building OpenCV 2.4.3 as 32 bit lib

asked Nov 8 '12

Theodor3 gravatar image

Hi,

i try to build OpenCV on my Ubuntu 12.4 (64 bit) as 32 bit library. I was setting the compiler flags like this:

cmake -G "Unix Makefiles" -D CMAKE_C_FLAGS=-m32 -D CMAKE_CXX_FLAGS=-m32 ..

Then i started to build the project. After some time i got this:

Linking CXX shared library ../../lib/libopencv_highgui.so
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../libImath.so when searching for -lImath
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../libImath.a when searching for -lImath
/usr/bin/ld: skipping incompatible /usr/lib/libImath.so when searching for -lImath
/usr/bin/ld: skipping incompatible /usr/lib/libImath.a when searching for -lImath
/usr/bin/ld: cannot find -lImath
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../libIlmImf.so when searching for -lIlmImf
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../libIlmImf.a when searching for -lIlmImf
/usr/bin/ld: skipping incompatible /usr/lib/libIlmImf.so when searching for -lIlmImf
/usr/bin/ld: skipping incompatible /usr/lib/libIlmImf.a when searching for -lIlmImf
/usr/bin/ld: cannot find -lIlmImf
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../libIex.so when searching for -lIex
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../libIex.a when searching for -lIex
/usr/bin/ld: skipping incompatible /usr/lib/libIex.so when searching for -lIex
/usr/bin/ld: skipping incompatible /usr/lib/libIex.a when searching for -lIex
/usr/bin/ld: cannot find -lIex
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../libHalf.so when searching for -lHalf
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../libHalf.a when searching for -lHalf
/usr/bin/ld: skipping incompatible /usr/lib/libHalf.so when searching for -lHalf
/usr/bin/ld: skipping incompatible /usr/lib/libHalf.a when searching for -lHalf
/usr/bin/ld: cannot find -lHalf
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../libIlmThread.so when searching for -lIlmThread
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../libIlmThread.a when searching for -lIlmThread
/usr/bin/ld: skipping incompatible /usr/lib/libIlmThread.so when searching for -lIlmThread
/usr/bin/ld: skipping incompatible /usr/lib/libIlmThread.a when searching for -lIlmThread
/usr/bin/ld: cannot find -lIlmThread
/usr/bin/ld: cannot find -lgtk-x11-2.0
/usr/bin/ld: cannot find -lgdk-x11-2.0
/usr/bin/ld: cannot find -latk-1.0
/usr/bin/ld: cannot find -lgio-2.0
/usr/bin/ld: cannot find -lpangoft2-1.0
/usr/bin/ld: cannot find -lpangocairo-1.0
/usr/bin/ld: cannot find -lgdk_pixbuf-2.0
/usr/bin/ld: cannot find -lcairo
/usr/bin/ld: cannot find -lpango-1.0
/usr/bin/ld: cannot find -lfreetype
/usr/bin/ld: cannot find -lfontconfig
/usr/bin/ld: cannot find -lgobject-2.0
/usr/bin/ld: cannot find -lglib-2.0
/usr/bin/ld: cannot find -lgthread-2.0
/usr/bin/ld: cannot find -lglib-2.0
/usr/bin/ld: cannot find -ldc1394
/usr/bin/ld: cannot find -lavcodec
/usr ...
(more)
Preview: (hide)

4 answers

Sort by » oldest newest most voted
0

answered Nov 12 '12

  1. There is no opencv2/opencv_highgui.hpp file in OpenCV source tree. There is modules/highgui/include/opencv2/highgui/highgui.hpp file and it is not empty. Do you make changes in source code?
  2. Install ia32-libs package. it includes 32-bit runtime libs for 64-bit platforms.
Preview: (hide)
0

answered Nov 8 '12

jachu gravatar image

Have you ever tried to compile it on 64-bit system? I've tried it for last few hours and it is failed every time. The problem is (in my case) in opencv2/opencv_highgui.hpp file, which is empty - has no defined options responsible for including other .hpp files required to complete compilation. It seems to be some general problem with highgui in this release.

Preview: (hide)

Comments

I could build it as 64 bit version without any problem.

Theodor3 gravatar imageTheodor3 (Nov 8 '12)edit

I have the same problem

Rajan Craveri gravatar imageRajan Craveri (Apr 22 '13)edit
0

answered Nov 9 '12

First of all you need to install 32-bit version of all listed libs. You tries to use 64-bit libs for linking and build fails.

Preview: (hide)

Comments

Yes, i know that this is the problem. But how to get the 32 bit version of this libs? I tried to use getlibs, but its not helping.

Theodor3 gravatar imageTheodor3 (Nov 9 '12)edit
0

answered Nov 8 '12

ponai gravatar image

updated Nov 9 '12

/usr/bin/ld: cannot find -lavcodec
/usr/bin/ld: cannot find -lavformat
/usr/bin/ld: cannot find -lavutil
/usr/bin/ld: cannot find -lswscale

========================================

It seems that you haven't installed ffmpeg correctly.

Preview: (hide)

Comments

ffmpeg is installed from ubuntu repositories, also libavcodec-dev, libavformat-dev, libswscale-dev

Theodor3 gravatar imageTheodor3 (Nov 9 '12)edit

Question Tools

Stats

Asked: Nov 8 '12

Seen: 5,962 times

Last updated: Nov 12 '12