opencv version 2.1.0-3ubuntu1 failed to build on i386

Bug #756154 reported by Matthias Klose on 2011-04-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenCV Manager
opencv (Ubuntu)

Bug Description

opencv version 2.1.0-3ubuntu1 failed to build on i386
Link to failed build:

Direct link to the build log:

This log snippet might be of interest, since it triggered the matcher 'Purging chroot-autobuild'.
Excerpt 3730 lines into the build log:

cd /build/buildd/opencv-2.1.0/obj-i686-linux-gnu/apps/haartraining && /usr/bin/c++ -DHAVE_CONFIG_H -g -O2 -Wall -pthread -march=i686 -ffunction-sections -O3 -DNDEBUG -fomit-frame-pointer -ffast-math -mfpmath=387 -DNDEBUG -I/usr/lib/pymodules/python2.7/numpy/core/include -I/build/buildd/opencv-2.1.0/. -I/build/buildd/opencv-2.1.0/obj-i686-linux-gnu -I/build/buildd/opencv-2.1.0/include -I/build/buildd/opencv-2.1.0/include/opencv -I/build/buildd/opencv-2.1.0/apps/haartraining -D PYTHON_USE_NUMPY=1 -o CMakeFiles/createsamples.dir/createsamples.o -c /build/buildd/opencv-2.1.0/apps/haartraining/createsamples.cpp
Linking CXX executable ../../bin/opencv_createsamples
cd /build/buildd/opencv-2.1.0/obj-i686-linux-gnu/apps/haartraining && /usr/bin/cmake -E cmake_link_script CMakeFiles/createsamples.dir/link.txt --verbose=1
/usr/bin/c++ -g -O2 -Wall -pthread -march=i686 -ffunction-sections -O3 -DNDEBUG -fomit-frame-pointer -ffast-math -mfpmath=387 -DNDEBUG -Wl,-Bsymbolic-functions CMakeFiles/createsamples.dir/createsamples.o -o ../../bin/opencv_createsamples -rdynamic ../../lib/ ../../lib/ ../../lib/libcvhaartraining.a ../../lib/ ../../lib/ ../../lib/ -llapack -lz ../../3rdparty/lib/libflann.a -ldl -lm -lpthread -lrt
../../lib/ undefined reference to `cvCreateCameraCapture_V4L(int)'
collect2: ld returned 1 exit status
make[3]: *** [bin/opencv_createsamples] Error 1
make[3]: Leaving directory `/build/buildd/opencv-2.1.0/obj-i686-linux-gnu'
make[2]: *** [apps/haartraining/CMakeFiles/createsamples.dir/all] Error 2
make[2]: Leaving directory `/build/buildd/opencv-2.1.0/obj-i686-linux-gnu'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/build/buildd/opencv-2.1.0/obj-i686-linux-gnu'
dh_auto_build: make -j1 returned exit code 2
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
Build finished at 20110408-1536
FAILED [dpkg-buildpackage died]
Purging chroot-autobuild/build/buildd/opencv-2.1.0

Related branches

Matthias Klose (doko) on 2011-04-10
Changed in opencv (Ubuntu):
importance: Undecided → High
Gal Shalif (gal-fourier) wrote :

The patch (draft) consist of:
 1. modification to debian/changelog, debian/control, debian/patches/series
 2. new file debian/patches/ubuntu11.04_no_videodev.h_include_file.patch

tags: added: patch
tags: added: oneiric
Changed in opencv (Ubuntu):
milestone: none → oneiric-alpha-1
Vincent Rabaud (vrabaud) wrote :

This has been fixed upstream, in trunk (2.3 is due in June) and version 2.2 (2.1 is not maintained anymore):

Changed in opencv (Ubuntu Oneiric):
milestone: oneiric-alpha-1 → oneiric-alpha-2
Martin Pitt (pitti) wrote :

Gal, does this library actually work with v4l devices with your patch? V4L1 support was completely removed in the Linux kernel, so merely bringing back the headers through libv4l1-dev won't help much: It will just fail to initialize at runtime.

The proper solution is to use v4l2 only, and the upstream patch seems to do that:

Can we backport this patch instead?

Changed in opencv (Ubuntu Oneiric):
status: New → Triaged
Gal Shalif (gal-fourier) wrote :

Update the merge ( with a rewrite of the patch that is now derived from upstream changeset (see Martin's comment above):

Here is the relevant entry from the debian/changelog:

  opencv (2.1.0-3ubuntu2) unstable; urgency=low

    * Add patch ubuntu11.04_no_videodev.h_include_file.patch - fix build error on Ubuntu 11.04 Natty (LP: #756154):
      - Backport the upstream 2.2 changeset to void the use of the obsolete V4L1 (linux/videodev.h)

   -- Gal Shalif (Work at Fourier Systems) <email address hidden> Wed, 01 Jun 2011 10:50:35 +0200

Note: Large V4L2-related changes from upstream are NOT included within this bugfix. See also at:
 * Upstream (i.e. version 2.2 file) with the V4L2-related changes:
 * Affected file (i.e. version 2.1 used by Ubuntu 11.04 Natty): src/highgui/cvcap_libv4l.cpp

Martin Pitt (pitti) wrote :

Subscribed sponsors.

Changed in opencv (Ubuntu Oneiric):
milestone: oneiric-alpha-2 → none
Reinhard Tartler (siretart) wrote :

This sponsorship request is blocked by bug #791527 (another, this time toolchain related, FTBFS bug)

Gal Shalif (gal-fourier) wrote :

Opps, the correct comment is: Add a fix for LP: #791527 - see new merge request at

Gal Shalif (gal-fourier) wrote :

Note on testing:
 * The new FFmpeg sources from Ubuntu 11.10 Oneiric do NOT compile against the OpenCV package (that is 2.1)
However, testing was OK with:
 * Ubuntu 11.04 Natty gcc 4.5
 * Ubuntu 11.10 Oneiric gcc 4.6 while using the old Ffmpeg sources from Ubuntu 11.04 Natty

Gal Shalif (gal-fourier) wrote :

More notes on testing:

After fixing the above bug - we get more build errors of the OpenCV package on Ubuntu 11.10 Oneiric because of:

1. The OpenCV 2.1 version is used
2. The new FFmpeg 0.7 version is used
3. OpenCV version 2.1 do not compile against the new FFmpeg version 0.7

AFAIK, the latest SVN version of OpenCV do not either compile against the new ffmpeg 0.7 and it is likely that the OpenCV developers will have to modify the OpenCV sources to allow a build against the new ffmpeg 0.7.

Gal Shalif (gal-fourier) wrote :

Verify that latest OpenCV-2.3.0rc.tar.bz2 (released on 2011-06-21) do also have compilation errors when compiled against Ffmpeg0.7 from Ubuntu 11.10 oneiric (OpenCV-2.3.0rc.tar.bz2 is available from

tags: added: universe
Gal Shalif (gal-fourier) wrote :

Add a patch for compiling opencv-2.1.0 agains libav-0.7 from Ubuntu 11.10 Oneiric.
Propose a branch merge at:

Jamie Strandboge (jdstrand) wrote :

Unsubscribing ubuntu-sponsors for now since the merge request needs fixing. Please resubscribe when the patch is ready.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package opencv - 2.1.0-3ubuntu2

opencv (2.1.0-3ubuntu2) oneiric; urgency=low

  [ Reinhard Tartler ]
  * enable parallel builds

  [ Gal Shalif (Work at Fourier Systems) ]
  * Add patch ubuntu11.04_no_videodev.h_include_file.patch
    - fix build error on Ubuntu 11.04 Natty (LP: #756154):
    - Backport the upstream 2.2 changeset to void the use
      of the obsolete V4L1 (linux/videodev.h)
  * Add patch ubuntu11.10_oneiric_fix_compilation_error_with_gcc4.6.patch
      - fix build error on Ubuntu 11.10 Oneiric (LP: #791527):
  * Add cvcap_ffmpeg_fix_compile_against_libav0.7.patch
      - fix compilation errors when compiled against libav-0.7
        (as applicable for Ubuntu 11.10 Oneiric) (LP: #756154)
 -- Gal Shalif (Work at Fourier Systems) <email address hidden> Thu, 07 Jul 2011 10:25:00 +0300

Changed in opencv (Ubuntu Oneiric):
status: Triaged → Fix Released
Gal Shalif (gal-fourier) wrote :

P.S. bugfix sources do build with both Ubuntu 11.04 Natty and the new Ubuntu 11.10 Oneiric

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.