2012年12月26日 星期三

在Codeblocks下導入OpenCV 2.4.x


教學
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
CodeBlock settings: search directory
Click add button for adding a new entry. In the popup dialog, type c:\opencv\build\include,
Add OpenCV include directory to CodeBlocks
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.
CodeBlocks linker settings
Click add for adding new entries and open a popup dialog.
CodeBlock settings: Add libraries to link
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.
Select OpenCV libraries
Click Open to add the files,
OpenCV libraries added to CodeBlocks
Click Ok to save all settings.

1 則留言:

  1. Harrah's Resort Southern California - JTA Hub
    Harrah's Resort Southern California. Harrah's 안성 출장마사지 Resort Southern California 의정부 출장마사지 is the largest casino 제주 출장안마 resort in the Valley and 오산 출장안마 features 4,748 spacious 나주 출장마사지 hotel rooms and suites

    回覆刪除