Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Next time, it will help a lot to also copy and paste the error that you're getting. Otherwise, we have to copy your code to our computers and try running it ourselves, which we shouldn't have to deal with.

  1. You're using cout, which are members of the iostream library. You'll need to add iostream to the top.
  2. The opencv C++ headers are located under opencv2/. Remove cv.h, highgui.h and add opencv2/core/core.hpp instead. Your example doesn't use anything from highgui, but if you need it in the future, you can replace highgui.h with opencv2/highgui.hpp
  3. Make sure you link against opencv when compiling. Adding "-lopencv_core" will compile your code.