基于Linux的opencv+QT开发环境搭建

来源:互联网 发布:无线路由器访客网络 编辑:程序博客网 时间:2024/04/29 07:27

    本来打算移植opencv2.0的没想到各种问题,起初怀疑是我的工具链版本问题,不过还没定位,后续还会继续尝试,我的搭建环境:

Ubuntu12.10 arm-linux-gcc 4.4.1 移植到三星cotex-A8的板子

Zlib-1.2.3

CC=arm-linux-gcc ./configure --prefix=/opt/arm --libdir=/opt/arm/lib --includedir=/opt/arm/include

make;make install(我这里install没有改变root权限是因为我把安装目录的权限改了)

Libpng-1.2.19

CC=arm-linux-gcc ./configure --prefix=/opt/arm --host=arm-linux --enable-shared LIBS=-L/opt/arm/lib CPPFLAGS=-I/opt/arm/include

make;make install

Jpegsrc v6

找不到libtool然后进入jpeg-6b的源码目录 #cp /usr/share/libtool/config/config.sub .

#cp /usr/share/libtool/config/config.guess .

重新configure make

Make install找不到/opt/arm/man/man1 mkdir /opt/arm/man/man1重新make install

CC=arm-linux-gcc ./configure --prefix=/opt/arm --host=arm-linux --enable-shared LIBS=-L/opt/arm/lib CPPFLAGS=-I/opt/arm/include

make;make install

Opencv-1.0.0

./configure --host=arm-linux  --disable-openmp --without-gtk --without-swig --without-python --without-carbon  --without-ffmpeg --without-1394libs  --without-quicktime  --without-gstreamer --enable-shared CXX=arm-linux-g++ CC=arm-linux-gcc CPPFLAGS=-I/opt/arm-linux/arm-2009q3/arm-none-linux-gnueabi/include LDFLAGS=-/opt/arm-linux/arm-2009q3/arm-none-linux-gnueabi/lib --prefix=/opt/arm/opencv --libdir=/opt/arm/opencv/lib --includedir=/opt/arm/opencv/include

make;make install

 

1.修改/opt/qt-4.7.1/mkspecs/default/qmake.conf

INCLUDEPATH += /opt/arm/opencv/include/opencv

LIBS += /opt/arm/opencv/lib/libcv.so \

/opt/arm/opencv/lib/libcvaux.so \

/opt/arm/opencv/lib/libcxcore.so \

/opt/arm/opencv/lib/libhighgui.so \

/opt/arm/opencv/lib/libml.so

2/etc/ld.so.conf.d/添加链接路径

3.修改LD_LIBRARY_PATH环境变量

4Qt调用Opencv库的配置

在建立的.pro文件后面添加

INCLUDEPATH += /usr/local/include/opencv/

LIBS += -L/usr/local/lib/ -lcv -lcvaux -lcxcore -lhighgui -lm

0 0
原创粉丝点击