Ask Your Question
3

first example code error

asked Nov 7 '14

federiko00 gravatar image

updated Nov 9 '14

berak gravatar image

hi all i've installed opencv version 3 from github....but when i try to do the first example code using Eclipse ( the code line way works well) i obtain this error and i don't know what to do. Thank you for your help

18:42:03 * Incremental Build of configuration Debug for project DI * make all Building file: ../src/DI.cpp Invoking: GCC C++ Compiler g++ -I/usr/local/include/opencv -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/DI.d" -MT"src/DI.d" -o "src/DI.o" "../src/DI.cpp" Finished building: ../src/DI.cpp

Building target: DI Invoking: GCC C++ Linker g++ -L/usr/local/lib -o "DI" ./src/DI.o -lopencv_core -lopencv_imgproc -lopencv_highgui /usr/bin/ld: ./src/DI.o: undefined reference to symbol '_ZN2cv6imreadERKNS_6StringEi' //usr/local/lib/libopencv_imgcodecs.so.3.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make: * [DI] Errore 1

18:42:03 Build Finished (took 763ms)

Preview: (hide)

Comments

I don't know how to solve this in particular, but I think these problems can be avoided if you follow these tutorials:

This worked for a lot of people, I hope this help you.

Rodrigo Berriel gravatar imageRodrigo Berriel (Nov 7 '14)edit

i exactly followed tutorials on opencv doc for opencv 3.0 and i get this problem

federiko00 gravatar imagefederiko00 (Nov 10 '14)edit
1

just to say: those tutorials I recommended have the same recomendation @berak did

Rodrigo Berriel gravatar imageRodrigo Berriel (Nov 13 '14)edit

@Mohsen Shafaghi

please do not post answers here, if you have a question or a comment, thank you.

(and no, this is not how this site works, noone will send you anything per mail, please do not expect anything like this)

berak gravatar imageberak (Apr 17 '19)edit

1 answer

Sort by » oldest newest most voted
7

answered Nov 9 '14

berak gravatar image

updated Nov 9 '14

imread/imwrite and friends were moved from highgui to a new imgcodecs module.

so you will have to

#include "opencv2/imgcodecs.hpp"

and link

-lopencv_imgcodecs

btw, include path should be:

-I/usr/local/include

not

-I/usr/local/include/opencv
Preview: (hide)

Comments

perfect! this works! i would be useful if these correction steps were added to the official opencv 3.0 pages tutorial!

federiko00 gravatar imagefederiko00 (Nov 10 '14)edit

frederiko00 , if you could point out errors/misleading parts in the tutorials, that would be definitely helpful to others !

berak gravatar imageberak (Nov 10 '14)edit

Really Great!!!Thanks for the answer;solved my issue too.As I am a beginner I was unaware of these changes.

Blue_Gene gravatar imageBlue_Gene (May 1 '15)edit

Thanks, This Worked perfectly for me

vikrammeena gravatar imagevikrammeena (Dec 29 '15)edit

So, am I reading this correctly? 18 months ago this problem and solution was posted. To date the tutorial has _still_ not been edited to reflect these updates. It makes it hard for us to convince the "pointy-haired boss" that linux/openCV is the proper approach when he gets error after error when following the tutorials verbatim.

TyWebb gravatar imageTyWebb (May 15 '16)edit

One year later and I just desperately copy pasted this very obscure error message into google, ended up here and lo and behold, the solution was right here. Thank you so much! A bit daunting when you try to learn something new and I end up spending hours discerning outdated installation instructions. Thanks again for the help!

MC Squidzy gravatar imageMC Squidzy (Jul 17 '17)edit

@MC Squidzy spammer?

LBerger gravatar imageLBerger (Jul 17 '17)edit

@LBerger, unsure.

berak gravatar imageberak (Jul 17 '17)edit

Question Tools

Stats

Asked: Nov 7 '14

Seen: 30,898 times

Last updated: Nov 09 '14