Precautions for installing and using OPENCV in LINUX

Source: Internet
Author: User
Tags gtk
Precautions for installing and using OPENCV in LINUX-Linux general technology-Linux technology and application information. For more information, see the following. After several days of hard work (almost a week .), Finally, we installed OPENCV in LINUX and the program in it was ready for normal use. What should have been successfully completed. However, it is an indisputable fact that many difficulties have been encountered.

Summarize the following precautions and hope to help you in the future: (problems may occur during installation on the OPENCV website)

1. When installing RH9, remember to install GTK +. Otherwise, all programs in OPENCV cannot be executed.

2. Remember to modify/etc/ld. so. conf.
Add a row/usr/local/lib

# Ldconfig (root User)

Then copy opencv. pc in/usr/local/lib/pkg-config to/usr/lib/pkg-config. (If you do not do this step, you cannot compile it)

You can use this operation
# Cp/usr/local/lib/pkg-config/opencv. pc/usr/lib/pkg-config

3. For congfigure, enter./configure -- without-python -- enable-static

Note: On my computer, if there is no first WITHOUT, MAKE will MAKE an error, helpless; the second is to generate a static Connection Library file when compiling the program (I have not understood how to generate it yet, Newbie ...)

Then, the prompt message is:
./Configure
Checking build system type... i686-pc-linux-gnu
Checking host system type... i686-pc-linux-gnu
Checking target system type... i686-pc-linux-gnu
Checking for a BSD-compatible install.../usr/bin/install-c
Checking whether build environment is sane... yes
Checking for gawk... no
......

General configuration ==================

Compiler: g ++

CXXFLAGS:-Wall-fno-rtti-pipe-O3-g-march = i686-ffast-math-fomit-frame-pointer

Install path:/usr/local

HighGUI configuration ==============================

Windowing system --------------
Use Carbon/Mac OS X: no
Use gtk + 2.x: yes
Use gthread: yes

Image I/O ---------------------
Use libjpeg: yes
Use zlib: yes
Use libpng: yes
Use libtiff: yes
Use libjasper: no
Use libIlmImf: no

Video I/O ---------------------
Use QuickTime/Mac OS X: no
Use xine: no
Use ffmpeg: no
Use dc1394 & raw1394: no
Use v4l: yes
Use v4l2: no

Wrappers for other extends ages ==================

SWIG
Python yes

Additional build settings ==============

Build demo apps yes

Now run make...

This is not the same as that on the Internet. It may be unable to move forward due to this problem in future work.

4. also note that the header file under OPENCV contains cv. h and highgui. h. All the files in the directory of the two files (remember/usr/local/include/opencv) are copied to/usr/include (don't ask me why, if you do not copy the file, the system prompts that the two header files cannot be found during program compilation)

5. How to compile the link file:

Take the cvtest. c file as an example (because c ++ is used in highgui, it must be compiled using g ++)

A. g ++ 'pkg-config -- cflags opencv '-o cvtest. c' pkg-config -- libs opencv'

B. Compile: g ++ 'pkg-config -- cflags opencv '-c cvtest. c

Link: g ++ 'pkg-config -- libs opencv '-o cvtest. o

Note: The Theme behind g ++ is ', which is the key under ESC.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.