Qt5.3.2(OpenGL)交叉编译

1、修改配置文件:qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf

#
# qmake configuration for building with arm-linux-gnueabi-g++
#

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

QMAKE_QPA_DEFAULT_PLATFORM = linuxfb #eglfs
QMAKE_CFLAGS_RELEASE    +=-O2 -march=armv7-a
QMAKE_CXXFLAGS_RELEASE  +=-O2 -march=armv7-a

QMAKE_INCDIR_EGL = /home/qt/mfg_rootfs/usr/include 
QMAKE_LIBDIR_EGL = /home/qt/mfg_rootfs/usr/lib
QMAKE_INCDIR_OPENGL_ES2 = /home/qt/mfg_rootfs/usr/include
QMAKE_LIBDIR_OPENGL_ES2 = /home/qt/mfg_rootfs/usr/lib
QMAKE_LIBS_EGL         += -lEGL
QMAKE_LIBS_OPENGL_ES2  += -lGLESv2 -lEGL -lGAL


include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

# modifications to g++.conf
QMAKE_CC                = arm-linux-gnueabihf-gcc
QMAKE_CXX               = arm-linux-gnueabihf-g++
QMAKE_LINK              = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = arm-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = arm-linux-gnueabihf-objcopy
QMAKE_NM                = arm-linux-gnueabihf-nm -P
QMAKE_STRIP             = arm-linux-gnueabihf-strip
load(qt_config)

2、执行配置命令:

./configure -v -opensource -confirm-license -no-pch -no-xcb -no-opengl -opengl es2 -make libs -xplatform linux-arm-gnueabi-g++ -compile-examples -device-option -no-gcc-sysroot -prefix $PWD/qtbase -no-openssl -qreal float

./configure -v -opensource -confirm-license -no-pch -no-xcb -no-opengl -opengl es2 -make libs -xplatform linux-arm-gnueabi-g++ -compile-examples -device-option -no-gcc-sysroot -prefix /usr/local/arm/qt5 -no-openssl -qreal float

3、编译和安装命令:

make -j4 && make install -j4

4、OpenGL库文件见附件

你可能感兴趣的:(Qt5,编程总结)