Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
808 views
in Technique[技术] by (71.8m points)

c++ - openCV 2.4.7 error adding symbols: DSO missing from command line

i've got a Problem with a self compiled opencv...

XUbuntu 13.10 x64 gcc version 4.8.1

cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_OPENMP=ON ..

Everthing looks fine. Simple examples will be work. My problem is, i want to use the nonfree(SURF) package in xubuntu.

Now i want to compile these example http://docs.opencv.org/doc/tutorials/features2d/feature_detection/feature_detection.html and get this error (Topic)

g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"example.d" -MT"example.d" -o "example.o" "../example.cpp" Finished building: ../example.cpp

Building target: SURF_Example Invoking: GCC C++ Linker

g++ -L/usr/local/lib -o "SURF_Example" ./example.o -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_objdetect -lopencv_nonfree

libopencv_features2d.so.2.4: error adding symbols: DSO missing from command line

Any help?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Probably, problem is in incorrect linking order and missing lib features2d. Try

g++ -L/usr/local/lib -o "SURF_Example" ./example.o -lopencv_nonfree -lopencv_objdetect -lopencv_features2d -lopencv_imgproc -lopencv_highgui -lopencv_core  

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...