Ask Your Question

Revision history [back]

I think the opencv/-headers are just legacy and should be replaced by the opencv2-headers. If you have a look at the old headers, they just include the new opencv2-headers. I can compile your code with these headers:

#include <opencv2 core="" core.hpp=""> #include <opencv2 highgui="" highgui.hpp="">

g++ foo.cpp -lopencv_core -lopencv_highgui

But there are also a logical error: You use argv[2] before checking if argc is 2.

click to hide/show revision 2
No.2 Revision

updated 2014-09-08 01:42:51 -0600

berak gravatar image

I think the opencv/-headers are just legacy and should be replaced by the opencv2-headers. If you have a look at the old headers, they just include the new opencv2-headers. I can compile your code with these headers:

#include <opencv2 core="" core.hpp="">

 #include <opencv2 highgui="" highgui.hpp="">

<opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp>

g++ foo.cpp -lopencv_core -lopencv_highgui

-lopencv_highgui

But there are also a logical error: You use argv[2] argv[1] before checking if argc is 2.