Unmet libbz2 linking dependecy for highgui (w/ ffmpeg) (Bug #47)


Added by Justin Eskesen about 15 years ago. Updated about 15 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:build/install
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Linking stage fails when linking against highgui if you're using ffmpeg. As it turns out, libavformat requires libbz2 (a change added in May 2008, according to ffmpeg's svn logs).

The error does not appear when linking the highgui library itself, but rather when linking an program with highgui.

Note: CMake supports bzip2 (FindBZip2).

[ 82%] Built target cvhaartraining
Linking CXX executable ../../bin/opencv_createsamples
../../lib/libhighgui.so.2.0.0: undefined reference to @BZ2_bzDecompress'
../../lib/libhighgui.so.2.0.0: undefined reference to @BZ2_bzDecompressInit'
../../lib/libhighgui.so.2.0.0: undefined reference to @BZ2_bzDecompressEnd'
collect2: ld returned 1 exit status
maker2: *** [bin/opencv_createsamples] Error 1
maker1: *** [apps/haartraining/CMakeFiles/createsamples.dir/all] Error 2
make: *** [all] Error 2

History

Updated by Justin Eskesen about 15 years ago

this modification seems to fix the problem...

>~/src/opencv_svn/opencv/src/highgui$ svn diff CMakeLists.txt
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt      (revision 2281)
+++ CMakeLists.txt      (working copy)
@@ -65,6 +65,7 @@

     if(HAVE_FFMPEG)
         set(highgui_srcs ${highgui_srcs} cvcap_ffmpeg.cpp)
+        set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} bz2)
     endif()

     if(HAVE_GSTREAMER)

Updated by Anatoly Baksheev about 15 years ago

patch submitted in r2681

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Also available in: Atom PDF