首先按照ti的教程编译Graphics_SDK_5_01_01_02,编译后安装到rootfs
下载qt4.8.6, 编译安装qt和tslib。
按照 打上2个补丁,不然编译出错。
先测试SDK的例程,一般能正常运行。
测试qt的opengl例程,会报错,/opt/qt-4.8.6-arm/examples/opengl/textures# ./textures -qws -display powervr
按照 ,解决错误。
build.sh:
#!/bin/bash
#-sysroot /home/maria/qt/qt-am335x/roofts.withSDK \
# -host-little-endian
./configure \
-opensource -confirm-license -release -shared \
-prefix ../qt-4.8.6-arm \
-embedded arm \
-platform qws/linux-x86_64-g++ \
-xplatform qws/linux-TIarmv7-sgx-g++ -depths 16,24,32 \
-little-endian \
-qt-libjpeg \
-qt-libpng \
-no-qt3support \
-no-libtiff -no-libmng \
-no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -no-webkit \
-qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -qt-mouse-tslib -plugin-mouse-linuxtp -plugin-mouse-pc -plugin-gfx-powervr -fast \
-D QT_NO_QWS_CURSOR -D QT_QWS_CLIENTBLIT \
-opengl es2 \
-nomake tests \
-I/usr/local/tslib/include \
-L/usr/local/tslib/lib
#-qt-zlib \
#-qt-sql-sqlite \
#-qt-freetype \
# -nomake examples \
qmake.conf文件内容 :
#
# qmake configuration for building with arm-linux-g++ - DM3730
#
MAKEFILE_GENERATOR = UNIX
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf)
#QT_QPA_DEFAULT_PLATFORM = eglfs
QT_INSTALL_DIR = $$PWD/../../..
SGX_SDK_ROOT = /usr/local/Graphics_SDK_5_01_01_02
TSLIB_INSTALL_DIR = /usr/local/tslib/
TSLIB_INCDIR = $$TSLIB_INSTALL_DIR/include
TSLIB_LIBDIR = $$TSLIB_INSTALL_DIR/lib
# CRTOOL_DIR=/opt/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin
CRTOOL_DIR=/opt/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/x86_64-arago-linux/usr/bin
#COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -mfloat-abi=hard
# modifications to g++.conf
QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -mfloat-abi=hard
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -mfloat-abi=hard
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_STRIP = arm-linux-gnueabihf-strip
#Do not edit beyond this
QMAKE_INCDIR_OPENGL_ES2 = $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include/
QMAKE_INCDIR_OPENGL_ES2 += $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/
QMAKE_INCDIR_OPENGL_ES2 += $$SGX_SDK_ROOT/include
QMAKE_INCDIR_OPENGL_ES2 += $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/
QMAKE_LIBDIR_OPENGL_ES2 = $$SGX_SDK_ROOT/gfx_dbg_es8.x/
QMAKE_LIBS_OPENGL_ES2 = -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lusc
QMAKE_INCDIR_OPENGL += $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/
QMAKE_LIBDIR_OPENGL = $$SGX_SDK_ROOT/gfx_dbg_es8.x
QMAKE_LIBDIR_OPENGL_QT = $$SGX_SDK_ROOT/gfx_dbg_es8.x
QMAKE_LIBS_OPENGL_ES1 = -lEGL -lGLES_CM -lIMGegl -lsrv_um -lusc
QMAKE_INCDIR_OPENVG = $$SGX_SDK_ROOT/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/
QMAKE_LIBDIR_OPENVG = $$SGX_SDK_ROOT/gfx_dbg_es8.x/
QMAKE_LIBS_OPENVG = -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lOpenVG -lOpenVGU
QMAKE_INCDIR_EGL = $$QMAKE_INCDIR_OPENGL_ES2
QMAKE_INCDIR_EGL += $$QT_INSTALL_DIR/src/3rdparty/powervr/wsegl2
QMAKE_INCDIR_POWERVR = $$QT_INSTALL_DIR/src/3rdparty/powervr/wsegl2
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBS_EGL = -lEGL -lIMGegl -lsrv_um -lGLESv2 -lGLES_CM -lusc
QMAKE_INCDIR += $$TSLIB_INCDIR
QMAKE_INCDIR += $$QMAKE_INCDIR_OPENGL_ES2
QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBDIR += $$TSLIB_LIBDIR
QMAKE_LIBS = $$QMAKE_LIBS_OPENGL_ES2 -lrt -lpthread -lts
load(qt_config)
QT5.5:
http://www.eefocus.com/marianna/blog/15-04/311437_e4f0a.html
配置脚本build.sh:
#!/bin/bash
#-sysroot /home/maria/qt/qt-am335x/roofts.withSDK \
CRTOOL_DIR=/opt/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/x86_64-arago-linux/usr/bin
./configure \
-opensource -confirm-license -shared \
-prefix ../qt-5.5-arm \
-platform linux-g++-64 \
-device linux-TIarmv7-sgx-g++ \
-device-option CROSS_COMPILE=$CRTOOL_DIR/arm-linux-gnueabihf- \
-qt-libjpeg \
-qt-libpng \
-no-sse2 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle \
-D QT_NO_QWS_CURSOR -D QT_QWS_CLIENTBLIT \
-eglfs -opengl es2 -qreal float \
-I/usr/local/tslib/include \
-L/usr/local/tslib/lib
#-qt-zlib \
#-qt-sql-sqlite \
#-qt-freetype \
# -nomake examples \
# -little-endian -host-little-endian \
# -no-qt3support
# -no-libtiff -no-libmng \
# -no-webkit
#-qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -qt-mouse-tslib -plugin-mouse-linuxtp -plugin-mouse-pc -plugin-gfx-powervr -fast
#-embedded arm \
qmake.conf:
#
# qmake configuration for building with arm-linux-g++ - DM3730
#
MAKEFILE_GENERATOR = UNIX
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
#include(../../common/qws.conf)
load(device_config)
QT_QPA_DEFAULT_PLATFORM = eglfs
QT_INSTALL_DIR = $$PWD/../../..
SGX_SDK_ROOT = /usr/local/Graphics_SDK_5_01_01_02
TSLIB_INSTALL_DIR = /usr/local/tslib/
TSLIB_INCDIR = $$TSLIB_INSTALL_DIR/include
TSLIB_LIBDIR = $$TSLIB_INSTALL_DIR/lib
# CRTOOL_DIR=/opt/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin
CRTOOL_DIR=/opt/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/x86_64-arago-linux/usr/bin
#COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -mfloat-abi=hard
# modifications to g++.conf
QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -mfloat-abi=hard
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -mfloat-abi=hard
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_STRIP = arm-linux-gnueabihf-strip
QMAKE_NM = arm-linux-gnueabihf-nm -P
#Do not edit beyond this
QMAKE_INCDIR_OPENGL_ES2 = $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include/
QMAKE_INCDIR_OPENGL_ES2 += $$SGX_SDK_ROOT/include
QMAKE_INCDIR_OPENGL_ES2 += $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/
QMAKE_LIBDIR_OPENGL_ES2 = $$SGX_SDK_ROOT/gfx_dbg_es8.x/
QMAKE_LIBS_OPENGL_ES2 = -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lusc
QMAKE_INCDIR_OPENGL += $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/
QMAKE_LIBDIR_OPENGL = $$SGX_SDK_ROOT/gfx_dbg_es8.x
QMAKE_LIBDIR_OPENGL_QT = $$SGX_SDK_ROOT/gfx_dbg_es8.x
QMAKE_LIBS_OPENGL_ES1 = -lEGL -lGLES_CM -lIMGegl -lsrv_um -lusc
QMAKE_INCDIR_OPENVG = $$SGX_SDK_ROOT/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/
QMAKE_LIBDIR_OPENVG = $$SGX_SDK_ROOT/gfx_dbg_es8.x/
QMAKE_LIBS_OPENVG = -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lOpenVG -lOpenVGU
QMAKE_INCDIR_EGL = $$QMAKE_INCDIR_OPENGL_ES2
QMAKE_INCDIR_EGL += $$QT_INSTALL_DIR/src/3rdparty/powervr/wsegl2
QMAKE_INCDIR_POWERVR = $$QT_INSTALL_DIR/src/3rdparty/powervr/wsegl2
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBS_EGL = -lEGL -lIMGegl -lsrv_um -lGLESv2 -lGLES_CM -lusc
QMAKE_INCDIR += $$TSLIB_INCDIR
QMAKE_INCDIR += $$QMAKE_INCDIR_OPENGL_ES2
QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBDIR += $$TSLIB_LIBDIR
QMAKE_LIBS = $$QMAKE_LIBS_OPENGL_ES2 -lts -lrt -lpthread
deviceSanityCheckCompiler()
load(qt_config)
补充:
error: no matching function for call to 'qBound
可以采用qt5.5.1
搜索Unable to create EGL surface, error = 0x300b
今天发现一个网站,有空看看
http://www.moore8.com/?utm_campaign=dianzixinxigang&utm_medium=navi&utm_source=eefocus&utm_content=moore8&utm_term=moore8
阅读(6204) | 评论(0) | 转发(0) |