We have not forgotten how to install opencv in Linux for a long time. Many problems are encountered, as shown below. The system is Ubuntu9.04, and Linux of other versions should be similar. It is installed in the vmwarevm and the host is Windows XP. I need to modify the opencv source code, so the source code compilation and installation method is not required for apt-get installation. 1. The first is to make Linux surfing the Internet through NAT sharing. NAT settings. Vmware
We have not forgotten how to install opencv in Linux for a long time.
Many problems are encountered, as shown below.
The system is Ubuntu 9.04, and other versions of Linux should be similar. Installed in a vmware virtual machine, the host is windows xp.
I need to modify the opencv source code, so the source code compilation and installation method is not required for apt-get installation.
1. The first is to make Linux surfing the Internet through NAT sharing.
NAT settings.
Choose "VM"> "Network Adapter" in "Settings" and select "NAT.
Write down the VMNET8 gateway address in the vmware menu edit-> virtual network editor (Note: This address is not the same as the windows vmnet8 IP address ).
/Etc/resolv. conf modify nameserver to the gateway address.
In/etc/network/interfaces, change the ip address to the network segment of VMNET8, and enter the gateway address.
Sudo/etc/init. d/networking restart
Then you can access the Internet.
You may need to set up local connections or wireless network connections in windows, right-click Properties, advanced, internet Connection Sharing, and allow other network users to access this computer ......
2. Download The cmake Linux version cmake-2.8.1-Linux-i386.tar.gz
Decompress the package in/home/user/cmake and modify the environment variable:
Modify/home/user/. bashrc in the user's home directory and add a row
PATH: = $ (PATH):/home/user/cmake/bin
3. Compile opencv
Download the opencv-2.1.0, unzip it under/home/user/Opencv-2.1.0,
Create a subdirectory build in this directory, that is, the location of the temporary file required to compile www.linuxidc.com.
In the build directory, run the following command (or create a script and then run it ):
Cmake-D CMAKE_BUILD_TYPE = RELEASE-D CMAKE_INSTALL_PREFIX =/usr/local-D BUILD_PYTHON_SUPPORT = ON ..
.. Indicates the upper-level directory
Makefile is generated. The default installation directory is/usr/local.
Next:
Make
Sudo make install
Add a/usr/local/lib line to the/etc/ld. so. conf file,
Run sudo ldconfig,
Compiled.