# 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.

 2 No.2 Revision berak 32993 ●7 ●81 ●312

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.