Check out example codes for "error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope". It will help you in understanding the concepts better.

Code Example 1

#include <opencv2/highgui/highgui.hpp>

since all the windowing stuff is in the highgui module, you'll need to include above header.

Example error:
[email protected]:~/test$ g++ create_ipl_image.cpp   `pkg-config opencv cvblob --cflags --libs` 
create_ipl_image.cpp: In function ‘int main()’:
create_ipl_image.cpp:14:31: error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope
      cvNamedWindow( "Image2", CV_WINDOW_AUTOSIZE );

Learn ReactJs, React Native from