Ask Your Question
-1

Opencv error

asked 2016-08-16 01:24:26 -0600

@boom gravatar image

updated 2016-08-16 01:52:33 -0600

berak gravatar image

Hello There i have opencv in my ubuntu platform .Today i started it and comile the programme but it tells many error while compiling it. Here it is

sachin@sachin-desktop:~/Desktop$ g++ `pkg-config --cflags opencv` haugh.cpp -o haugh `pkg-config --libs opencv`


/usr/bin/ld: warning: libjpeg.so.62, needed by /usr/local/lib/libopencv_imgcodecs.so, not found (try using -rpath or -rpath-link)
/usr/lib/libtiff.so.4: undefined reference to `jpeg_read_raw_data'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_resync_to_restart'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_std_error'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_CreateDecompress'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_start_compress'
/usr/lib/libjasper.so.1: undefined reference to `jpeg_default_colorspace'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_set_quality'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_read_header'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_alloc_huff_table'
/usr/lib/libtiff.so.4: undefined reference to `jpeg_write_raw_data'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_destroy_decompress'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_stdio_dest'
/usr/lib/libtiff.so.4: undefined reference to `jpeg_destroy'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_calc_output_dimensions'
/usr/lib/libtiff.so.4: undefined reference to `jpeg_abort'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_finish_compress'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_destroy_compress'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_finish_decompress'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_set_defaults'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_start_decompress'
/usr/lib/libtiff.so.4: undefined reference to `jpeg_suppress_tables'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_write_scanlines'
/usr/lib/libtiff.so.4: undefined reference to `jpeg_set_colorspace'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_CreateCompress'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_read_scanlines'
/usr/lib/libtiff.so.4: undefined reference to `jpeg_write_tables'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_simple_progression'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `jpeg_stdio_src'
collect2: ld returned 1 exit status
edit retag flag offensive close merge delete

Comments

how did you install opencv ?

(opencv_imgcodecs was not loaded because jpeg is missing / wrong version)

berak gravatar imageberak ( 2016-08-16 01:43:53 -0600 )edit

sir i actually update my system after that it is not running.

@boom gravatar image@boom ( 2016-08-16 06:13:10 -0600 )edit
1

this means, now you have a different set of jpg/tiff libs, than your opencv libs were built with

again, try to rebuild opencv from src.

berak gravatar imageberak ( 2016-08-16 06:16:27 -0600 )edit

Sir how can i do it i see all steps of installation from http://docs.opencv.org/2.4/doc/tutori...

@boom gravatar image@boom ( 2016-08-17 00:50:40 -0600 )edit

please use opencv3 docs , not the 2.4 ones !

berak gravatar imageberak ( 2016-08-17 01:02:37 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-08-16 01:48:18 -0600

berak gravatar image

updated 2016-08-17 00:59:05 -0600

try to rebuild the opencv libs with

cmake -DBUILD_JPEG=ON -DBUILD_TIFF=ON -DBUILD_PNG=ON

so it's using the 3rd party libs that come with opencv, not your system libs.

edit flag offensive delete link more

Comments

Or make sure that before running the cmake, you install all prerequisites for OpenCV as described here.

StevenPuttemans gravatar imageStevenPuttemans ( 2016-08-16 07:47:32 -0600 )edit
1

cmake -DBUILD_JPEG -DBUILD_TIFF -DBUILD_PNG Parse error in command line argument: -DBUILD_JPEG Should be: VAR:type=value CMake Error: No cmake script provided. CMake Error: Problem processing arguments. Aborting.

@boom gravatar image@boom ( 2016-08-17 00:54:47 -0600 )edit

apologies, it has to be -DBUILD_JPEG=ON, etc. please see edit above.

berak gravatar imageberak ( 2016-08-17 01:00:27 -0600 )edit

Yes command run correct but again no change in o/p while compiling the code. In opencv docs there is command but when i run it Here is the error. CMake Error: The source directory "/home/sachin/Desktop/pics" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. THIS IS THE COMMAND cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/home/sachin/opencv /home/sachin/opencv is the folder path and /usr/local/include/opencv2 is my library path

@boom gravatar image@boom ( 2016-08-17 01:13:52 -0600 )edit

last (missing) argument to the cmake cmdline should be the opencv src folder (where CmakeLists.txt is)

berak gravatar imageberak ( 2016-08-17 01:22:49 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-08-16 01:24:26 -0600

Seen: 3,568 times

Last updated: Aug 17 '16