centos 編譯安裝opencv測試

2021-08-19 20:31:52 字數 993 閱讀 6001

1.centos具體版本:

2.安裝步驟:

1).安裝依賴:

//sudo yum groupinstall "development tools" -y

sudo yum install gcc cmake gtk2-devel numpy pkgconfig -y

github:

3).解壓opencv3.3.1.zip檔案到當前資料夾(~/downloads/):

cd ~/downloads

unzip opencv3.3.1.zip

4).編譯原始檔和安裝:

cd ~/downloads/opencv-3.3.1

mkdir build

cd build

sudo cmake -d cmake_build_type=release -d cmake_install_prefix=/usr/local ..

sudo make

sudo make install

5).配置環境變數:

export pkg_config_path=$pkg_config_path:/usr/local/lib/pkgconfig/

##最好將這個命令寫入shell的配置檔案中,不然每次登入都需要執行一次

sudo echo '/usr/local/lib' >> /etc/ld.so.conf.d/opencv.conf

sudo ldconfig

6).執行乙個測試例子:

/*test.cpp*/

#include #include #include int main(int argc,char *argv)

g++ -g test.cpp `pkg-config --cflags --libs opencv` 

或者g++ -g test.cpp  $(pkg-config --cflags --libs opencv)

./a.out

CentOS 編譯安裝 Lua LuaSocket

centos5.5 lua5.1.4 luasocket2.0.2 usr bin ld cannot find lreadline 直接 make 會報錯,缺少依賴。yum y install gcc make ncurses devel readline devel wget tar zxvf ...

CentOS 編譯安裝 Lua LuaSocket

centos5.5 lua5.1.4 luasocket2.0.2 usr bin ld cannot find lreadline 直接 make 會報錯,缺少依賴。yum y install gcc make ncurses devel readline devel wget tar zxvf ...

Centos 編譯安裝ACE

這裡只安裝了ace,其他的包沒有涉及。1.tar xvf ace x.x.x.tar.gz 2.設定環境變數 vim bashrc export ace root home yourname export ld library path ld library path ace root ace cd...