Attempted compilation results of unsuccessful sample code
I am unsure where the symbol "_ZN2cv9rectangleERKNS_17_InputOutputArrayENS_6Point_IiEES4_RKNS_7Scalar_IdEEiii" comes from. This is OpenCV 3.0 from github. Is there unfinished code to make this work right, or do I need to do something else before adding the correct additions to cmake?
% g++ -o MatchTemplate_Demo MatchTemplate_Demo.cpp -g -O2 -lopencv_imgcodecs /usr/bin/ld: /tmp/cciu3kDK.o: undefined reference to symbol '_ZN2cv9rectangleERKNS_17_InputOutputArrayENS_6Point_IiEES4_RKNS_7Scalar_IdEEiii'
/usr/lib/libopencv_imgproc.so.3.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status
you are linking imgcodecs, but that is simply not enough. try
-lopencv_imgcodecs -lopencv_imgproc -lopencv_core -lopencv_highgui