Because opencv is loaded with source code and compiled and installed by itself, it is different from sudoapt-get .......... so codeblocks + opencv tutorials on Ubuntu, which have been around for a long time on the Internet, are only applicable to terminal installation. The following is a copy of countless Tutorials: I recently wrote an article about CodeBlocks + OpenCV2.0 configuration in Windows using OpenCV. Yesterday, I installed a U
Because opencv is loaded with source code and compiled and installed by itself, it is different from sudo apt-get in terminal .......... so codeblocks + opencv tutorials on Ubuntu, which have been around for a long time on the Internet, are only applicable to terminal installation. The following is a copy of countless Tutorials:
I recently wrote an article about CodeBlocks + OpenCV2.0 configuration in Windows using OpenCV. Yesterday, I installed a Ubuntu, So I installed CodeBlocks, OpenCV, and a platform under Linux. The installation process is as follows:
I. CodeBlocks Installation
1. Install the basic compiling environment
Code:
Sudo apt-get install build-essential
Sudo apt-get install gdb
2 install codeblock
Code:
Sudo apt-get install codeblocks
Sudo apt-get install codeblocks-dbg
Sudo apt-get install wxformbuilder
Another codeblocks-contrib is actually installed with wxSmith. I still like wxfb, so it is not installed.
3 install wxWidgets
Code:
Sudo apt-get install libwxbase2.8
Sudo apt-get install libwxbase2.8-dev
Sudo apt-get install libwxgtk2.8-0
Sudo apt-get install libwxgtk2.8-dev
Sudo apt-get install libwxgtk2.8-dbg
Sudo apt-get install wx-common
Sudo apt-get install wx2.8-headers
Sudo apt-get install wx2.8-i18n
Wx2.8-examples and wx2.8-doc can be installed
4. Configure codeblock
Open codeblock
Settings-> global variables
Click the new button next to the current variable label and enter wx in the box.
Then under builtin fields
Base/usr
Include/usr/include/wx-2.8
Lib/usr/lib
Click close to save the settings. After the settings are complete, a simple helloworld dialog box is created for the New gui project. But the system prompts whether to find the. h file. So I went viral and looked around the world on google. After a delay of more than an hour, there was no result. Later, codeblock was turned off in anger. After opening the file, all the files are successfully compiled.
Ii. Installation of OpenCV
Sudo apt-get install libcv1 libcvaux1 libhighgui1
Sudo apt-get install libcv-dev libcvaux-dev libhighgui-dev
3. Configure CodeBlocks
Settings-> Compiler and debugger settings
Add-lcv-lcxcore-lhighgui in the Other Linker options: Of linker settings.
Add the directory/usr/include/opencv under Search directories-> Compiler
Add the directory/usr/lib under the Linker tab on the right.
Success
In fact, this only step-by-step tutorial is everywhere in mainland China. Some of the things that mention the principle are rejected by GFW. Let me talk about this kind of dish... I am afraid I will forget it.
Many lib files are displayed in the tutorial .. Why do I need to link the lib library during compilation? Everyone knows this... So I just need to find these libraries of lib and add them to the Linker Settings of settings-> Compiler and debugger settings .. Unlike what it says, I don't understand what wx does. I have added a bunch of usr/local/lib/libopev-XXX stuff.
Next, we add the include static Link Library in compiler of search directories, and I have another one in/usr/local/include/opencv.
/Usr/local/include/opencv.
Then add usr/local/usr to the linker.
At this time, the path settings of the link opencv library in the compilation phase are completed... In fact, it is to set the path of these libraries... Do not copy a bunch of useless copies .. None