教學
A.安裝Code::Blocks附帶MinGW版本
http://www.codeblocks.org/downloads/26
B.下載openCV將之解壓縮在C:\ (不能解壓縮在使用者資料夾)
C.修改環境變數,增加PATH=C:\opencv\build\x86\mingw\bin
D.下載MinGW(gcc 4.6),並且安裝(安裝時選擇預設,不要選擇下載最新程式碼)
D.1.將安裝後的C:\MinGW\bin\libstdc++-6.dll複製到CodeBlocks安裝資料夾內的MinGW\bin\
E.設定CodeBlocks編譯器參數
1. Add the OpenCV header files directory
Open Settings → Compiler and debugger... → Search directories tab → Compiler tab
Click add button for adding a new entry. In the popup dialog, type c:\opencv\build\include,
and click Ok.
1-2. Add the OpenCV library files directory
Open Settings → Compiler and debugger... → Search directories tab → Linker tab
Click add button for adding a new entry. In the popup dialog, type C:\opencv\build\x86\mingw\lib,
2. Add the OpenCV libraries needed for linking
Open Settings → Compiler and debugger... → Linker settings tab.
Click add for adding new entries and open a popup dialog.
Click the "..." button to open the File Open Dialog. Go to c:\opencv\build\x86\mingw\libdirectory and select all files by pressing Ctrl-A.
Click Open to add the files,
Click Ok to save all settings.