I am new to opencv, and learning from "opencv by example" book.
I finished the installation and wanted to run an example : opencv_version.cpp as suggested. In the book it said I need to run this:
g++ -ggdb 'pkg-config --cflags --libs opencv3' opencv_version.cpp -o /tmp/opencv_version && /tmp/opencv_version
but afterward I got error saying that pkg-config ... is not found. After googling, apparently the problem is , I should use ` insetad of '
SO then I ran
g++ -ggdb `pkg-config --cflags --libs opencv3` opencv_version.cpp -o /tmp/opencv_version && /tmp/opencv_version
Yes It started compiling , but I got the following error:
/tmp/ccLwWorD.o: In function `main':
/home/osboxes/opencv-3.0.0/samples/cpp/opencv_version.cpp:12: undefined reference to `cv::CommandLineParser::CommandLineParser(int, char const* const*, cv::String const&)'
/home/osboxes/opencv-3.0.0/samples/cpp/opencv_version.cpp:14: undefined reference to `cv::CommandLineParser::has(cv::String const&) const'
AND SO ON
which in short is undefined reference to commandlineparser.
Here is some snapshot of the source code:
#include <opencv2/core/utility.hpp>
//some code here
cv::CommandLineParser parser(argc, argv, keys); //line 12
Can anyone help me to fix the error? What does -ggdb in the g++ command mean/do? I googled it but couldn't find it?