Image1 = imread("cross.png", CV_LOAD_IMAGE_COLOR) Now create a new project in codeblocks and write your code with the inclusion of required header files by your code (Read Documents of OpenCV).Copy Everything from “C:\opencv\build_codeblocks\install\圆4\mingw\bin” to “C:\TDM-GCC-64\bin”.Copy libopencv_ (number 343 can change with new release of Opencv) from “C:\opencv\build_codeblocks\install\圆4\mingw\lib” to “C:\TDM-GCC-64\x86_64-w64-mingw32\lib”.Copy opencv and opencv2 folders from “C:\opencv\build_codeblocks\install\include” to “C:\TDM-GCC-64\x86_64-w64-mingw32\include”.On Successful build continue to following steps. Go to : Build->Select Target and select “install” option.So resolve it add header file time.h (#include )to the file top in which the error is shown. Error2 : time was not found in this scope.Save the changes each time using Ctrl+s and click build every time you make changes to files.
So change the functions to the equivalents. The Error1 will be shown 4 or 5 times.strncpy( szKey, icvWindowPosRootKey, 1024 ).The format of latter is different from previous one. To resolve it use the function strncpy and strncat respectively. Error 1 : strcpy_s and strcat_s are not declared in this namespace.There Will Few Errors those will be shown while building :.Now From Build option in menu bar click on Build.Go to tab Compiler Flags and Select option “Have g++ follow C++11 ISO C++ language standard ”.In option compiler’s installation directory choose the path “C:\TDM-GCC-64” Which is the path of installation of GCC compiler.Before building we have to configure Codeblocks.Now in directory Opencv_codeblocks a codeblock project file will be created with extension cbp.Click build again and after that click generate.Now you will see some options in table like structure.These are same folder we have created earlier. Select path “C:/Opencv/Opencv_codeblocks” in Option Where to build the binaries.Select path “C:/Opencv/opencv/sources” in Option Where is the source code.
HOW TO CHANGE CODEBLOCKS COMPILER TO GNU 17 HOW TO
Watch below video to know how to add the the path to environment variables.
HOW TO CHANGE CODEBLOCKS COMPILER TO GNU 17 .EXE
OpenCv 3.4.1 Windows self-extracting archive Download.