




已阅读5页,还剩30页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
ubuntu10.10建立QT开发环境一、安装g+,ubuntu默认是不带g+的,如果不安装的话,后面是无法进行桌面版的qt应用程序进行编译的,在终端中执行以下命令:sudo apt-get install g+二、安装arm-linux-gcc 3.3.2我们使用的是优龙公司提供的arm-linux-gcc 3.3.2交叉编译工具链(1)在/usr/local目录下arm目录,用于存放解压后的交叉编译工具链sisesise:/sisefile/crosschain$ cd /usr/local/sisesise:/usr/local$ sudo mkdir arm(2)解压交叉编译工具链sisesise:$ cd sisefile/crosschain/sisesise:/sisefile/crosschain$ sudo tar -jxvf cross-3.3.2.tar.bz2 -C /usr/local/arm(3)查看目录sisesise:/sisefile/crosschain$ cd /usr/local/arm/3.3.2/sisesise:/usr/local/arm/3.3.2$ ls(4)添加交叉编译工具链环境变量方法一:建立环境变量设置脚本:sisesise:/usr/local/arm/3.3.2$ sudo gedit arm-linux-gcc-3.3.2-env.sh添加以下内容:# add my crosschain(arm-linux-gcc-3.3.2) pathexport PATH=/usr/local/arm/3.3.2/bin$:PATH 使用arm-linux-gcc 3.3.2时,可以进入存放arm-linux-gcc-3.3.2-env.sh的目录,在终端执行以下命令:source arm-linux-gcc-3.3.2-env.sh这样就能使arm-linux-gcc-3.3.2-env.sh生效方法二:修改profile文件:sisesise:/usr/local/arm/3.3.2$ sudo gedit /etc/profile添加以下内容:# add arm-linux-gcc 3.3.2 crosschain pathexport PATH=/usr/local/arm/3.3.2/bin:$PATH三、安装桌面版QT(1)为QT增加可执行属性sisesise:/usr/local/arm/3.3.2$ cd /home/sise/sisefile/qt4/sisesise:/sisefile/qt4$ sudo chmod +x qt-sdk-linux-x86-opensource-2010.04.bin (2)执行qt的二进制文件:sisesise:/sisefile/qt4$ ./qt-sdk-linux-x86-opensource-2010.04.bin安装QT的过程:我修改了安装目录,具体目录如下:这里一步要注意了,这里有提示说如果我们要使用qt,需要安装以下的文件:提示内容:Apart from a C+ compiler, a number of development libraries need to be present to enable Qt Creator to build your Qt applications. On Debian and Ubuntu, use the following command in a terminal to make sure they are installed: sudo apt-get install libglib2.0-dev libSM-dev libxrender-dev libfontconfig1-dev libxext-devIf youre using QtOpenGL, youll also need OpenGL development files. You can use the following command to find out which packages to install: sudo apt-get install libgl-dev libglu-dev(3)安装libgl-dev libglu-dev包:sisesise:/sisefile/qt4$ sudo apt-get install libglib2.0-dev libSM-dev libxrender-dev libfontconfig1-dev libxext-dev(4)安装libgl-dev libglu-dev包:sisesise:/usr/local/arm/3.3.2$ sudo apt-get install libgl-dev libglu-dev提示没有libgl-dev包(5)安装libgl1-mesa-dev libglu-dev包:sisesise:/usr/local/arm/3.3.2$ sudo apt-get install libgl1-mesa-dev libglu-dev至此桌面版的QT就安装完成了(6)添加环境变量添加在qcreator中环境变量(其实这一步时不需要的,因为在qt安装完成后,不需要再设置环境变量的)找到qmake(7)建立一个helloword工程测试:选择qt的版本向工程中添加一个c+文件:在main.cpp文件中添加以下代码:#include #include int main(int argc,char* argv) QApplication app(argc,argv); QLabel* label = new QLabel(hello world); label-show(); return app.exec();编译出现以下的窗口,证明我们已经完成了qt的安装:(8)编译qvfbqvfb是个X11模式下的qte的模拟器,没有开发板的同学可以利用qvfb来仿真qte的程序。在安装qt的文件夹中已经包含了qvfb的工程,我们需要的是对它进行编译:打开,然后编译,出现了一下错误:这是由于缺少了deviceskin.h和deviceskin.cpp文件,在安装qt的文件夹中同样存在这两个文件将这两个文件复制到qvfb工程目录中重新打开工程,编译,出现以下错误:这是由于缺少png库,安装png库:sisesise:$ sudo apt-get install libpng-dev继续编译,又出现以下错误:这是由于系统缺少glui和xorg库,安装glui和xorg库:sisesise:$ sudo apt-get install libglui-devsisesise:$ sudo apt-get install xorg-dev重新编译qvfb工程,出现以下窗口,这时终于成功了!生成的文件在qt/bin目录下:设置qvfb的环境变量:# add qt4.6.3 for x86 pathexport PATH=/home/sise/siseapp/qtsdk-2010.04/qt/bin:$PATH四、安装qt-embedded-x86版的qt(1)进入siseapp目录,建立qt4.6.3_embedded_x86文件夹,用来存放解压后的该版本的qtsisesise:$ cd siseapp/sisesise:/siseapp$ mkdir qt4.6.3_embedded_x86(2)解压qt源文件文件,制定解压后存放的目录为刚才建立的目录:sisesise:/siseapp$ cd /home/sise/sisefile/qt4/sisesise:/sisefile/qt4$ tar -zvxf qt-everywhere-opensource-src-4.6.3.tar.gz -C /home/sise/siseapp/qt4.6.3_embedded_x86(3)配置qt的编译选项:sisesise:/sisefile/qt4$ cd /home/sise/siseapp/qt4.6.3_embedded_x86/qt-everywhere-opensource-src-4.6.3/sisesise:/siseapp/qt4.6.3_embedded_x86/qt-everywhere-opensource-src-4.6.3$ ./configure -prefix /home/sise/siseapp/qt-embedded-4.6.3-x86 -embedded x86 -qvfb选择 o选择yes(4)编译sisesise:/siseapp/qt4.6.3_embedded_x86/qt-everywhere-opensource-src-4.6.3$ make(4)安装sisesise:/siseapp/qt4.6.3_embedded_x86/qt-everywhere-opensource-src-4.6.3$ make install(5)在qcreator中添加刚才编译的qt版本的环境变量:(5)重新利用该版本的qt编译helloworld工程打开helloworld工程:选择该版本qt的环境变量设置run setting我们先打开qvfbsisesise:/siseapp/qt4.6.3_embedded_x86/qt-everywhere-opensource-src-4.6.3$ qvfb &然后编译仿真,出现以下窗口,证明我们的qt又编译成功了:五、编译安装tslib:Tslib是一个开源的程序,能够为触摸屏驱动获得的采样提供诸如滤波、去抖、校准等功能,通常作为触摸屏驱动的适配层,为上层的应用提供了一个统一的接口。(1)进入tslib存放源文件的文件夹,解压tslib:sisesise:$ cd sisefile/tslib1.4/sisesise:/sisefile/tslib1.4$ tar -zxvf tslib-1.4.tar.gz(2)注:此步需要一些工具,ubuntu下需要安装automake、autoconf、libtool,可以执行下面语句安装,sudo apt-get install automake autoconf libtool,不然的话,我们是无法执行autogen.sh脚本的:sisesise:/sisefile/tslib1.4$ sudo apt-get install automake autoconf libtool(3)进入解压后的tslib文件夹,执行autogen.sh脚本文件:sisesise:/sisefile/tslib1.4$ cd tslib/sisesise:/sisefile/tslib1.4/tslib$ ./autogen.sh(4)配置tslib的选项:sisesise:/sisefile/tslib1.4/tslib$ ./configure -prefix=/usr/local/tslib/ -host=arm-linux ac_cv_func_malloc_0_nonnull=yes(5)编译tslib:sisesise:/sisefile/tslib1.4/tslib$ make(6)安装tslib:sisesise:/sisefile/tslib1.4/tslib$ sudo make install(7)修改ts.conf:sisesise:/sisefile/tslib1.4/tslib$ sudo gedit /usr/local/tslib/etc/ts.conf将第二行“#module_raw input”注释去掉,变为“module_raw input”,注意一定要顶格。(8)以下内容是在开发板的linux系统中修改的,现在由于优龙fs2410使用的cramfs文件系统是只读的,我们无法修改,这个要等到我们做出yaffs文件系统后,才能做。打开profile:$vi /etc/profile添加内容如下:export TSLIB_ROOT=/tslibexport TSLIB_TSDEVICE=/dev/event0export LD_LIBRARY_PATH=/tslib/lib:$LD_LIBRARY_PATHexport TSLIB_FBDEVICE=/dev/fb0export TSLIB_PLUGINDIR=/tslib/lib/tsexport TSLIB_CONSOLEDEVICE=noneexport TSLIB_CONFFILE=/tslib/etc/ts.confexport TSLIB_CALIBFILE=/etc/pointercalexport TSLIB_TSEVENTTYPE=H3600export QWS_SIZE=320*240export QWS_MOUSE_PROTO=Tslib:/dev/event0export QWS_DISPLAY=LinuxFb:mmWidth50:mmHeight65:0export POINTERCAL_FILE=/etc/pointercalexport QWS_SW_CURSORexport QWS_KEYBOARD=TTY:/dev/tty1export set QTDIR=/opt/qtexport PATH=$QTDIR:$PATHexport LD_LIBRARY_PATH=$QTDIR/lib:$QTDIR/plugins/imageformats:$LD_LIBRARY_PATHexport QT_PLUGIN_PATH=$QTDIR/plugins/export QT_QWS_FONTDIR=$QTDIR/lib/fonts六、安装arm版qt(1)建立存放解压后的qt的文件夹sisesise:/sisefile/tslib1.4/tslib$ cd /home/sise/siseapp/sisesise:/siseapp$ mkdir qt-embedded-4.6.3-armsisesise:/siseapp$ mkdir qt_4.6.3_embedded_arm(2)解压qtsisesise:/siseapp$ cd /home/sise/sisefile/qt4/sisesise:/sisefile/qt4$ lsqt-everywhere-opensource-src-4.6.3.tar.gzqt-sdk-linux-x86-opensource-2010.04.binsisesise:/sisefile/qt4$ tar -zvxf qt-everywhere-opensource-src-4.6.3.tar.gz -C /home/sise/siseapp/qt_4.6.3_embedded_arm/(3)安装libjpeg-dev包sisesise:/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3$ sudo apt-get install libjpeg-dev(4)我们来查看一下qt有哪些可选的配置编译选项:输入以下命令:sisesise:/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3$ ./configure -help可以看到以下的选项Usage: configure -h -prefix -prefix-install -bindir -libdir -docdir -headerdir -plugindir -datadir -translationdir -sysconfdir -examplesdir -demosdir -buildkey -release -debug -debug-and-release -developer-build -shared -static -no-fast -fast -no-largefile -largefile -no-exceptions -exceptions -no-accessibility -accessibility -no-stl -stl -no-sql- -sql- -plugin-sql- -system-sqlite -no-qt3support -qt3support -platform -D -I -L -help -qt-zlib -system-zlib -no-gif -qt-gif -no-libtiff -qt-libtiff -system-libtiff -no-libpng -qt-libpng -system-libpng -no-libmng -qt-libmng -system-libmng -no-libjpeg -qt-libjpeg -system-libjpeg -make -nomake -R -l -no-rpath -rpath -continue -verbose -v -silent -no-nis -nis -no-cups -cups -no-iconv -iconv -no-pch -pch -no-dbus -dbus -dbus-linked -no-separate-debug-info -no-mmx -no-3dnow -no-sse -no-sse2 -qtnamespace -qtlibinfix -separate-debug-info -armfpa -no-optimized-qmake -optimized-qmake -no-xmlpatterns -xmlpatterns -no-multimedia -multimedia -no-phonon -phonon -no-phonon-backend -phonon-backend -no-audio-backend -audio-backend -no-openssl -openssl -openssl-linked -no-gtkstyle -gtkstyle -no-svg -svg -no-webkit -webkit -no-javascript-jit -javascript-jit -no-script -script -no-scripttools -scripttools -no-declarative -declarative additional platform specific options (see below)Installation options: These are optional, but you may specify install directories. -prefix . This will install everything relative to (default /usr/local/Trolltech/Qt-4.6.3) * -prefix-install . Force a sandboxed local installation of Qt. This will install into /usr/local/Trolltech/Qt-4.6.3, if this option is disabled then some platforms will attempt a system install by placing default values to be placed in a system location other than PREFIX. You may use these to separate different parts of the install: -bindir . Executables will be installed to (default PREFIX/bin) -libdir . Libraries will be installed to (default PREFIX/lib) -docdir . Documentation will be installed to (default PREFIX/doc) -headerdir . Headers will be installed to (default PREFIX/include) -plugindir . Plugins will be installed to (default PREFIX/plugins) -datadir . Data used by Qt programs will be installed to (default PREFIX) -translationdir . Translations of Qt programs will be installed to (default PREFIX/translations) -sysconfdir . Settings used by Qt programs will be looked for in (default PREFIX/etc/settings) -examplesdir . Examples will be installed to (default PREFIX/examples) -demosdir . Demos will be installed to (default PREFIX/demos) You may use these options to turn on strict plugin loading. -buildkey . Build the Qt library and plugins using the specified . When the library loads plugins, it will only load those that have a matching key.Configure options: The defaults (*) are usually acceptable. A plus (+) denotes a default value that needs to be evaluated. If the evaluation succeeds, the feature is included. Here is a short explanation of each option: * -release . Compile and link Qt with debugging turned off. -debug . Compile and link Qt with debugging turned on. -debug-and-release . Compile and link two versions of Qt, with and without debugging turned on (Mac only). -developer-build . Compile and link Qt with Qt developer options (including auto-tests exporting) -opensource . Compile and link the Open-Source Edition of Qt. -commercial . Compile and link the Commercial Edition of Qt. * -shared . Create and use shared Qt libraries. -static . Create and use static Qt libraries. * -no-fast . Configure Qt normally by generating Makefiles for all project files. -fast . Configure Qt quickly by generating Makefiles only for library and subdirectory targets. All other Makefiles are created as wrappers, which will in turn run qmake. -no-largefile . Disables large file support. + -largefile . Enables Qt to access files larger than 4 GB. -no-exceptions . Disable exceptions on compilers that support it. * -exceptions . Enable exceptions on compilers that support it. -no-accessibility . Do not compile Accessibility support. * -accessibility . Compile Accessibility support. -no-stl . Do not compile STL support. * -stl . Compile STL support. -no-sql- . Disable SQL entirely. -qt-sql- . Enable a SQL in the QtSql library, by default none are turned on. -plugin-sql- Enable SQL as a plugin to be linked to at run time. Possible values for : db2 ibase mysql oci odbc psql sqlite sqlite2 sqlite_symbian tds -system-sqlite . Use sqlite from the operating system. -no-qt3support . Disables the Qt 3 support functionality. * -qt3support . Enables the Qt 3 support functionality. -no-xmlpatterns . Do not build the QtXmlPatterns module. + -xmlpatterns . Build the QtXmlPatterns module. QtXmlPatterns is built if a decent C+ compiler is used and exceptions are enabled. -no-multimedia . Do not build the QtMultimedia module. + -multimedia . Build the QtMultimedia module. -no-audio-backend . Do not build the platform audio backend into QtMultimedia. + -audio-backend . Build the platform audio backend into QtMultimedia if available. -no-phonon . Do not build the Phonon module. + -phonon . Build the Phonon module. Phonon is built if a decent C+ compiler is used. -no-phonon-backend. Do not build the platform phonon plugin. + -phonon-backend. Build the platform phonon plugin. -no-svg . Do not build the SVG module. + -svg . Build the SVG module. -no-webkit . Do not build the WebKit module. + -webkit . Build the WebKit module. WebKit is built if a decent C+ compiler is used. -no-javascript-jit . Do not build the JavaScriptCore JIT compiler. + -javascript-jit . Build the JavaScriptCore JIT compiler. -no-script . Do not build the QtScript module. + -script . Build the QtScript module. -no-scripttools . Do not build the QtScriptTools module. + -scripttools . Build the QtScriptTools module. + -no-declarative .Do not build the declarative module. -declarative . Build the declarative module. -platform target . The operating system and compiler you are building on (linux-g+). See the README file for a list of supported operating systems and compilers. -graphicssystem Sets an alternate graphics system. Available options are: raster - Software rasterizer opengl - Rendering via OpenGL, Experimental! -no-mmx . Do not compile with use of MMX instructions. -no-3dnow . Do not compile with use of 3DNOW instructions. -no-sse . Do not compile with use of SSE instructions. -no-sse2 . Do not compile with use of SSE2 instructions. -qtnamespace Wraps all Qt library code in namespace . -qtlibinfix Renames all libQt*.so to libQt*.so. -D . Add an explicit define to the preprocessor. -I . Add an explicit include path. -L . Add an explicit library path. -help, -h . Display this information.Third Party Libraries: -qt-zlib . Use the zlib bundled with Qt. + -system-zlib . Use zlib from the operating system. See /zlib -no-gif . Do not compile the plugin for GIF reading support. * -qt-gif . Compile the plugin for GIF reading support. See also src/plugins/imageformats/gif/qgifhandler.h -no-libtiff . Do not compile the plugin for TIFF support. -qt-libtiff . Use the libtiff bundled with Qt. + -system-libtiff . Use libtiff from the operating system. See -no-libpng . Do not compile in PNG support. -qt-libpng . Use the libpng bundled with Qt. + -system-libpng . Use libpng from the operating system. See /pub/png -no-libmng . Do not compile the plugin for MNG support. -qt-libmng . Use the libmng bundled with Qt. + -system-libmng . Use libmng from the operating system. See http:/www.lib
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年无人机应用基础考试题库附答案详解
- 2025年护士执业资格考试真题及答案
- 慢性膀胱炎合并神经源性膀胱护理查房
- 阿坝藏族羌族自治州2024-2025学年八年级下学期语文月考模拟试卷
- 安徽省安庆市望江县2023-2024学年高二上学期期末考试化学考题及答案
- 2025 年小升初武汉市初一新生分班考试数学试卷(带答案解析)-(人教版)
- 2025 年小升初哈尔滨市初一新生分班考试数学试卷(带答案解析)-(人教版)
- 第一章 三角形的初步知识 过关检测试卷(含答案)2025-2026学年浙教版2024 数学八年级上册
- 资金垫付合同范本
- 源画摄影合同范本
- 人教版高一下学期期末考试数学试卷与答案解析(共五套)
- SYT 5822-2021 油田化学剂分类及命名规范-PDF解密
- 人教版小学3-6年级英语单词表,已A4排版,可直接打印
- 制造业班组长培训
- 研发项目策划书
- 创作属于自己的国画作品
- 烟草行业基础知识培训课件
- 《花生膜下滴灌技术》课件
- 2024年江苏高科技投资集团有限公司招聘笔试参考题库含答案解析
- 办公室文员员工职责
- 完整版江苏省政府采购专家库入库考试题库(1-4套卷)
评论
0/150
提交评论