查看“MY-IMX6-EK140 Qt4.8.5移植”的源代码
←
MY-IMX6-EK140 Qt4.8.5移植
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
<div> = 移植ARM版的Qt4.8(porting Qt4.8 of ARM version) = == tslib移植(tslib porting) == === 编译tslib库(Compile tslib library) === 1 解压tslib (unzip tslib) unzip tslib-master<br> 2 进入tslib目录,指定交叉编译工具 <br> <span style="background:#CCCCCC">Into the tslib directory, specify the cross-compile tools<br> export CC=/home/myzr/6ul-tools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc-4.9.23<br> 3 生成配置文件 (generate the configuration file) ./autogen.sh<br> 4 配置 (configure) ./configure --host=arm-linux-gnueabihf --prefix=/usr/local/tslib<br> 5 编译 (compile) make<br> 6 安装(install) sudo make install <br> 会在/usr/local下生成tslib目录,安装完成<br> <span style="background:#CCCCCC">Tslib directory will be generated in / usr / local when the installation is completed.<br> 7 进入交叉编译工具的库的目录,把编译好的tslib的库复制到交叉编译工具的库的目录 <br> <span style="background:#CCCCCC">Get into the cross-compiler tools library directory, copy the compiled tslib library to cross-compile tools library directory<br> cp /usr/local/tslib/lib/libts* ./ -a<br> == 移植Qt (porting Qt)== === 编译Qt库(Compile tslib library) === 1 解压Qt源码 (unzip Qt source code) tar xvf qt-everywhere-opensource-src-4.8.5<br> 2 进入Qt源码目录(Get into Qt source code directory) vim mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf<br> 3 修改交叉编译工具 (revise cross-compile tools) # modifications to g++.conf<br> QMAKE_CC = /home/myzr/6ul-tools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc-4.9.2 -lts<br> QMAKE_CXX = /home/myzr/6ul-tools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -lts<br> QMAKE_LINK = /home/myzr/6ul-tools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -lts<br> QMAKE_LINK_SHLIB = /home/myzr/6ul-tools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -lts<br> <br> # modifications to linux.conf<br> QMAKE_AR = /home/myzr/6ul-tools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-ar cqs<br> QMAKE_OBJCOPY = /home/myzr/6ul-tools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-objcopy<br> QMAKE_STRIP = /home/myzr/6ul-tools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-strip<br> 保存退出(Save & Esc)<br> 4 vim mkspecs/common/linux.conf 在QMAKE_LIBS_THREAD = -lpthread 后面添加(Added later) -lts :<br> QMAKE_LIBS_THREAD = -lpthread -lts<br> 保存退出(Save & Esc)<br> 5 配置 (configure) ./configure -embedded arm -xplatform qws/linux-arm-gnueabi-g++ -little-endian -host-little-endian -no-opengl -no-openssl -nomake examples -nomake docs <br> 6 编译 (compile) make<br> 编译时间1-2小时(configure needs about 1-2 hours)<br> 7 安装 (install) sudo make install<br> 安装完成,会在/usr/local目录下生成Trolltech目录。<br> <span style="background:#CCCCCC">Trolltech will be generated in / usr / local directory when the installation is completed.<br> === 编译tslib插件(compile tslib plugin) === 1 在Qt源码目录 (in Qt source code directory) cd src/plugins/generic/tslib/<br> 2 复制tslib头文件到当前目录 <span style="background:#CCCCCC">Copy the tslib header file to the current directory cp /usr/local/tslib/include/tslib.h ./<br> 3 编译 (compile) make<br> 4 安装 (install) sudo make install<br> 安装完成,会在/usr/local/Trolltech/QtEmbedded-4.8.5-arm/plugins/generic/目录下生成libqtslibplugin.so<br> <span style="background:#CCCCCC"> libqtslibplugin.so will be generated in /usr/local/Trolltech/QtEmbedded-4.8.5-arm/plugins/generic/ local directory when the installation is completed.<br> == 开发板环境搭建(Development board environment building) == === 拷贝库(copy library) === 1 把/usr/local下的Trolltech 目录 复制到 开发板的 /usr/local目录下<br> <span style="background:#CCCCCC">Copy Trolltech directory in /usr/local to /usr/local directory in development board<br> 2 把/usr/local 下的tslib 目录 复制到 开发板的 /usr/local 目录下 <br> <span style="background:#CCCCCC">Copy tslib directory in /usr/local to /usr/local directory in development board<br> === 设置环境变量(set environment variables) === 1 vi /etc/profile 加入(add):<br> export TSLIB_ROOT=/usr/local/tslib<br> export TSLIB_CALIBFILE=/etc/pointercal<br> export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf<br> export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts<br> export TSLIB_TSDEVICE=/dev/input/event1<br> export TSLIB_FBDEVICE=/dev/fb0<br> <br> export LD_LIBRARY=/usr/local/Trolltech/QtEmbedded-4.8.5-arm/lib<br> export QT_QWS_FONTDIR=/usr/local/Trolltech/QtEmbedded-4.8.5-arm/lib/fonts<br> export QWS_MOUSE_PROTO=tslib:/dev/input/event1<br> 保存退出(Save & Esc)<br> 到此, 开发版的Qt运行环境就搭建好了。<br> <span style="background:#CCCCCC">Now, the Qt operating environment of development board has been set up.<br> == Qt应用程序的编译(Qt application compilation) == === 设置Qtcreator环境(set up Qtcreator environment) === 1 到Qt官网下载Qt安装包(Download Qt installation package from Qt’s website): [http://download.qt.io/archive/qt/5.5/5.5.0/ http://download.qt.io/archive/qt/5.5/5.5.0/] qt-opensource-linux-x86-5.5.0.run 是linux下32位的(32 bit);<br> qt-opensource-linux-x64-5.5.0-2.run 是linux 下64位的(64 bit)。<br> 根据需要下载。(download as needed)<br> 2 下载完成后把安装包放到linux下,用鼠标双击运行,会弹出安装界面,根据自己需求安装。<br> <span style="background:#CCCCCC">Put the installation package into linux after downloading, double-click with the mouse to run, will pop-up installation interface, install it according to your needs.<br> 3 安装完成后会得到一个Qt Creator(Community),在桌面可能看不到,可以在linux下搜索“Qt”,然后打开它;也可以在Qt安装目录下的Tools/QtCreator/bin/找到qtcreator,然后运行它,打开之后 <br> <span style="background:#CCCCCC">You will get a Qt Creator (Community) after the installation is completed , may not be visible on the desktop, you can search for "Qt" in linux and open it; you can also find qtcreator in the Qt installation directory under Tools / QtCreator / bin / , then open it and run it.<br> 在菜单栏里Tools -> Options ;找到"Build & Run"。(To find “Build & Run" in menu Tools -> Options<br> 添加“Compilers”,“add”添加交叉编译工具,选择前面编译Qt源码的交叉编译工具。<br> <span style="background:#CCCCCC">Add "Compilers", "add" add cross compiler tools, select the front compiler Qt source cross compiler tools<br> 添加“Qt Versions”, “add”添加qmake,选择前面编译好的qmake(/usr/local/bin/qmake)。<br> <span style="background:#CCCCCC">Add "Qt Versions", "add" add qmake, select the front compiled qmake (/ usr / local / bin / qmake).<br> 添加“Kits”,“add”添加一个Kit,自己命名,然后选择“Compiler”和“Qt Version”,这两个是选择上两步添加的“Compiler”和“Qt Version”。<br> <span style="background:#CCCCCC">Add "Kits", "add" Add a Kit, name it yourself, then select "Compiler" and "Qt Version", which are the "Compiler" and "Qt Version" that you selected in the two steps above.<br> 最后“OK”退出。(Finally “Ok” Esc)<br> === Qt应用程序创建(Qt application created) === 1 菜单栏(menu): File->New File or Project。<br> 2 Application -> Qt Widgets Application。 <br> 3 输入项目名字,选择创建路径,下一步。<br> <span style="background:#CCCCCC">Enter the project name, choose to created path, next step<br> 4 kit的选择,选择2.4.1中添加的Kit;下一步。 <br> <span style="background:#CCCCCC">kit selection, select the Kit added in 2.4.1; next step.<br> 5 输入类的名字,这里用默认,“Base class”选择QWidget,下一步。 <br> <span style="background:#CCCCCC">Enter the name of the class, here with the default, "Base class" to select QWidget, next step<br> 6 Finish。 = 7 Forms下有个ui文件,双击打开它。<br> <span style="background:#CCCCCC">Forms have a ui file, double-click to open it.<br> 8 在左边栏里 Display Widgets 下有个 Label,用鼠标拖到设计界面上去,然后双击label,输入“hello world !”。 <br> <span style="background:#CCCCCC">There is a label in the left column under the Display Widgets, drag the mouse to the design interface, and then double-click the label, type "hello world!". <br> 9 编译,点击左下角的锤子形状的按钮编译,编译完成会在创建目录生成可执行文件,把它放到开发板上就可以运行了。<br> <span style="background:#CCCCCC">Compile, click the lower left corner of the hammer shape button to compile, compile will be created in the directory to create an executable file, put it on the development board can run. <br> </div>
返回至
MY-IMX6-EK140 Qt4.8.5移植
。
导航菜单
个人工具
登录
命名空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
[-_-]
NXP平台:
MYZR-IMX6-EK200
MYZR-IMX6-EK200(EN)
MYZR-IMX6-EK314
MYZR-IMX6-EK314(EN)
MYZR-IMX6-EK336
MYZR-IMX6-EK336(EN)
MYZR-IMX6-EK140
MYZR-IMX6-EK140(EN)
MYZR-IMX6-EK140P
MYZR-IMX6-EK140P(EN)
MYZR-IMX8M-EK300
MYZR-IMX8M-EK300(EN)
MYZR-IMX8M-EVK
MYZR-IMX8Mmini-EK240
MYZR-IMX8Mmini-EK240(EN)
MYZR-IMX28-EK142
MYZR-IMX28-EK142(EN)
MYZR-LS1012A-EK200
MYZR-LS1012A-EK200(EN)
Rockchip平台:
MYZR-RK3288-EK314
MYZR-RK3288-EK314(EN)
MYZR-RK3399-EK314
MYZR-RK3399-EK314(EN)
Allwinner平台:
MYZR-R16-EK166
MYZR-R16-EK166(EN)
Microchip平台:
MYZR-SAMA5-EK200
MYZR-SAMA5-EK200(EN)
网关产品:
GW200
GW300
GW310/GW311
ST平台:
MYZR-STM32-EK152
所有页面
工具
链入页面
相关更改
特殊页面
页面信息