Reputation: 183
as soon as i add to my code
FlannBasedMatcher matcher;
i get the following error when building
g++ -o "track" ./track.o -lopencv_imgproc -lopencv_features2d -lopencv_nonfree -lopencv_core -lopencv_highgui -lopencv_video /usr/bin/ld: ./track.o: undefined reference to symbol '_ZN2cv5flann12SearchParamsC1Eifb' //usr/lib/x86_64-linux-gnu/libopencv_flann.so.2.4: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status
any idea? I am running Ubuntu
Thanks
Upvotes: 0
Views: 448
Reputation: 1124
Answer from an earlier question (Strange linking error: DSO missing from command line)
You should mention the library on the command line after the object files being compiled
So, in your case:
nm -AD --defined-only /usr/lib64/libopencv_so. | grep _ZN2cv5flann12SearchParamsC1Eifb /usr/lib64/libopencv_flann.so.2.4:0000000000029650 T _ZN2cv5flann12SearchParamsC1Eifb /usr/lib64/libopencv_flann.so.2.4.9:0000000000029650 T _ZN2cv5flann12SearchParamsC1Eifb
g++ fbm.cc -o fbm -lopencv_flann -lopencv_imgproc -lopencv_features2d -lopencv_nonfree -lopencv_core -lopencv_highgui -lopencv_video
Code sample for testing:
#include <opencv2/features2d/features2d.hpp>
using namespace cv;
FlannBasedMatcher matcher;
int main()
{}
Upvotes: 1