Ask Your Question
1

OpenCV 2.4.11 Failed to Build

asked 2015-06-29 02:25:04 -0500

dida gravatar image

updated 2015-06-29 03:21:35 -0500

System: Ubuntu 15.04 x64

While make all -j 4, this is what I get after 51%

[ 51%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_mser.cpp.o
../../lib/libopencv_highgui.a(cap_ffmpeg.cpp.o): In function `CvVideoWriter_FFMPEG::writeFrame(unsigned char const*, int, int, int, int, int)':
cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG10writeFrameEPKhiiiii+0x18c): undefined reference to `avcodec_encode_video'
../../lib/libopencv_highgui.a(cap_ffmpeg.cpp.o): In function `CvVideoWriter_FFMPEG::close()':
cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG5closeEv+0x146): undefined reference to `avcodec_encode_video'
collect2: error: ld returned 1 exit status
modules/highgui/CMakeFiles/opencv_test_highgui.dir/build.make:381: recipe for target 'bin/opencv_test_highgui' failed
make[2]: *** [bin/opencv_test_highgui] Error 1
CMakeFiles/Makefile2:1875: recipe for target 'modules/highgui/CMakeFiles/opencv_test_highgui.dir/all' failed
make[1]: *** [modules/highgui/CMakeFiles/opencv_test_highgui.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 51%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_main.cpp.o
[ 51%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_fast.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_nearestneighbors.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_brisk.cpp.o
[ 52%] Building CXX object modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/perf/perf_cicrlesGrid.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_descriptors_regression.cpp.o
[ 52%] Building CXX object modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/perf/perf_main.cpp.o
Linking CXX executable ../../bin/opencv_perf_calib3d
Linking CXX executable ../../bin/opencv_test_features2d
[ 52%] Built target opencv_perf_calib3d
[ 52%] Built target opencv_test_features2d
Makefile:147: recipe for target 'all' failed
make: *** [all] Error 2

Any pointer?

edit retag flag offensive close merge delete

Comments

Can you post your cmake parameters as well ?

dastaan90 gravatar imagedastaan90 ( 2015-06-29 03:41:05 -0500 )edit

Cool. Looks like you didn't have ffmpeg path set.

dastaan90 gravatar imagedastaan90 ( 2015-06-29 04:27:54 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2015-06-29 04:19:06 -0500

dida gravatar image

Running

export LD_LIBRARY_PATH=/ffmpeg_install_path/lib/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/ffmpeg_install_path/lib/pkgconfig
export PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR:/ffmpeg_install_path/lib/

before make -j 4 seems did it.

I couldn't seems to post my own answer so this is it.

edit flag offensive delete link more

Comments

Now you can accept it ;)

StevenPuttemans gravatar imageStevenPuttemans ( 2015-06-29 06:20:48 -0500 )edit

Hi,

You might notice that it is due to vtl4. I found two pages helpful regarding the same - http://code.opencv.org/issues/3726

https://github.com/opencv/opencv/commit/864b4e3b2628c2669ebfb3e11e3cbab9ab95e8af (https://github.com/opencv/opencv/comm...)

and also I followed these steps - https://gist.github.com/dynamicguy/3d1fce8dae65e765f7c4#file-install-opencv-2-4-11-in-ubuntu-sh-L19 (https://gist.github.com/dynamicguy/3d...)

In short, I had to fix the patch by myself using github as help. And also I used WITH_FFMPEG=OFF with cmake step.

Hopefully it helps otherwise reach out to me :D

Thanks

pallav bakshi gravatar imagepallav bakshi ( 2017-01-19 15:08:19 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-06-29 02:25:04 -0500

Seen: 2,696 times

Last updated: Jun 29 '15