QT builds on each platform Qt-everywhere

Source: Internet
Author: User

Qt for Windows7-64bit

Install MinGW (search MinGW for Windows) on your computer, add C:\MinGW\bin to the environment variable, open the command line to enter GCC--version and g++--version and Mingw32-make-- Version verifies that the installation was successful

Unzip the qt-everywhere-opensource-src-4.8.1.tar.gz and enter the directory

Configure-debug-and-release-opensource-platform win32-g++-webkit
Mingw32-make

Add Qt-everywhere-opensource-src-4.8.1/bin to Path

Qmake–version
Mingw32-make docs generate Doc-build folder document

QT is installed and the cmd command line generates the executable file using the following command

Qmake-projectqmakemingw32-make//debug directory Generate executable file debug\ filename. exe
Ubuntu 12.04-32bit Linux X11 Platform

For x Window System (e.g. Solaris, AIX, HP-UX, Linux, BSD)

Tar zxvf qt-everywhere-opensource-src-4.8.1.tar.gz

Put the following 3 packages in front of the./configure

sudo apt-get install Libx11-dev libxext-dev Libxtst-dev
./configure-debug-developer-build-opensource-shared-fast-no-multimedia-xmlpatterns-no-audio-backend-no-phonon- Svg-no-webkit-javascript-jit-script-scripttools-declarative-declarative-debug-qt-zlib-qt-libtiff  - Qt-libpng  -qt-libmng-no-openssl-verbose-optimized-qmake-no-xinerama-no-xvideo-no-xshape-no-xsync
Make
Make install

QT has been installed, use the following command to build the executable file

/usr/local/trolltech/qt-4.8.1/bin/qmake-project   //qmake default installation path/usr/local/trolltech/qt-4.8.1/bin/qmakemake./ The resulting executable file

Build, install, and configure QT under Linux

Http://www.cnblogs.com/emouse/archive/2013/01/28/2880142.html

Embedded x86 Platform

You can remove infrequently used components and features by compiling. With its own Windows system QWS, it is written directly to the Linux framebuffer without the need to rely on X Window systems. can reduce memory consumption. The virtual frame buffer qvfb is provided to facilitate embedded testing on the desktop system.

Unzip the qt-everywhere-opensource-src-4.8.1.tar.gz and enter

Apt-get Install Qt4-dev-tools
./configure-embedded X86-qvfb-no-webkit
Make
Make install

QT Embedded x86 is installed in/usr/local/trolltech/qtembedded-4.8.1, inside the qmake, Moc,uic etc are for embedded x86, used to compile the embedded program

QT is installed, test

/usr/local/trolltech/qtembedded-4.8.1/bin/qmake-project/usr/local/trolltech/qtembedded-4.8.1/bin/qmakemakeqvfb -width 800-height &     //Open QVFB to display the program./executable file name-QWS//                 program displayed on QVFB

Qt is based on the C/S model, that is, the client/server model, QT If you need to run a graphical interface program requires server-side support. This server side is QWS server. By default, the embedded-side system does not start QWS server, so if you have only one graphical interface program, you must add the-QWS parameter to it as a server so that you can start Qws server.

Embedded Arm Platform

Set up the MTK development environment on Linux according to the manual, install the cross-compiling tool (ARMV6Z-MEDIATEK451_001_VFP-LINUX-GNUEABI-GCC This command on Linux)

Unzip the qt-everywhere-opensource-src-4.8.1.tar.gz and enter

Create the armv6z-mediatek451_001_vfp-linux-gnueabi/folder under qt-everywhere-opensource-src-4.8.1/mkspecs/qws/, copy the linux-arm-g+ + Qplatformdefs.h and qmake.conf under the directory to Armv6z-mediatek451_001_vfp-linux-gnueabi, modify the qmake.conf, add the following two lines in the qmake.conf

QT_CFLAGS_DIRECTFB =-i/opt/share/release/bdp_linux/oss/library/directfb/usr/include/directfb-d_reentrant

QT_LIBS_DIRECTFB =-l/opt/share/release/bdp_linux/oss/library/directfb/lib-ldirectfb-lfusion-ldirect-lpthread

(Decompression RELEASE/BDP_LINUX/OSS/LIBRARY/DIRECTFB)

The following is the contents of the qmake.conf file

# Qmake configuration for building with Armv6z-mediatek-linux-gnueabi-g++include (.. /.. /common/linux.conf) include (.. /.. /common/gcc-base-unix.conf) include (.. /.. /common/g++-unix.conf) include (.. /.. /common/qws.conf) # modifications to G++.CONFQMAKE_CC = ARMV6Z-MEDIATEK451_001_VFP-LINUX-GNUEABI-GCCQMAKE_CX X = Armv6z-mediatek451_001_vfp-linux-gnueabi-g++qmake_link = Armv6z-mediatek451_001_vfp-linux-g                Nueabi-g++qmake_link_shlib = armv6z-mediatek451_001_vfp-linux-gnueabi-g++# Modifications to Linux.confQMAKE_AR = Armv6z-mediatek451_001_vfp-linux-gnueabi-ar Cqsqmake_objcopy = Armv6z-mediatek451_001_vfp-linux-gnu Eabi-objcopyqmake_strip = ARMV6Z-MEDIATEK451_001_VFP-LINUX-GNUEABI-STRIPQT_CFLAGS_DIRECTFB =-I/opt/share/rele ASE/BDP_LINUX/OSS/LIBRARY/DIRECTFB/USR/INCLUDE/DIRECTFB-D_REENTRANTQT_LIBS_DIRECTFB =-L/opt/share/release/BDP_ Linux/oss/library/directfb/lib-ldirectfb-lfusion-ldirect-lpthreadload (Qt_Config 

Modify Qt-everywhere-opensource-src-4.8.1/src/corelib/io/io.pri

linux-*|armv6z-*:{     //linux-* back plus |armv6z-*

Then install

./configure-release-embedded Arm-fast-xplatform Qws/armv6z-mediatek451_001_vfp-linux-gnueabi-v- Developer-build-opensource-xmlpatterns-svg-no-webkit-javascript-jit-script-scripttools-declarative- Optimized-qmake-reduce-relocations-exceptions-depths All-lrt-qt-zlib-qt-libtiff-qt-libpng-qt-libmng-qt-libjpeg- Qt-freetype-no-dbus-nomake examples-nomake demos-nomake Docs-nomake translations-no-largefile-no-phonon-no-phonon- Backend-no-opengl-no-multimedia-no-audio-backend-no-declarative-debug-plugin-gfx-directfb-no-gfx-transformed- No-gfx-qvfb-no-gfx-vnc-no-gfx-multiscreen-no-gfx-qnx-no-gfx-integrityfb-little-endian-host-little-endian- Qt-sql-sqlite-openssl-linked-i/home/release/bdp_linux/oss/library/openssl/usr/include-l/home/release/bdp_linux /oss/library/openssl/usr/lib-lssl-lcrypto-prefix/opt/share/qt-4.8.1-arm (Remember to unzip release/bdp_linux/oss/library/ Openssl,-i and-L paths may vary (i=include, l=library) 

-xplatform Parameters

QT uses Qmake to generate makefile, in order for QT to compile on different platforms, QT pre-defines some platform makefile variables. These variables vary in value depending on the build platform. If QMAKE_CC is equal to ARM-LINUX-GCC under Arm-linux, these variables exist in the file named Qmake.conf. When Qmake generates makefile, the value of this file is used. QT has written the appropriate qmake.conf for all tested platforms, all in the Mkspecs directory under the QT directory, where the platform for the Qt Window System (QWS) is placed under MKSPECS/QWS.

-xplatform is to tell configure which qmake.conf is used to generate the QT 4.8.1 library makefile.

Configure-xplatform qws/linux-arm-g++ means the use of qws/linux-arm-g++ qmake.conf, and this format is very simple, so if you have a new embedded platform, you can build a similar qmake.conf in Qws, just use Xplatform notify configure. But the directory name must be linux-xxxx-g++ (so the red character above is modified because our qmake.conf folder does not start with Linux)

-prefix parameters

Path to QT installation

Configure after completion, follow the prompts

Gmake
Gmake Install

Installation successful, test

/qt-4.8.1-armv6z/bin/qmake-project/qt-4.8.1-armv6z/bin/qmakemake

Cross compilation succeeded

QT Compilation Error resolution

Build NFS.

Mount the program to the board with the command: Mount-o nolock 192.168.100.182:/opt/nfs/mnt/ubi_boot/nfs

The NFS mount default options include file locks, which depend on the dynamic port allocation feature provided by Portmap, a simple workaround: Kill file Lock (LOCKD) or Mount-o nolock

-O options are mainly used to describe the device or file mount mode, because many embedded device root file system without Portmap, so generally use the-o nolock parameter, that is, do not use NFS file lock, so you can avoid the use of portmap.

After the mount is successfully copied to the/mnt/ubi_boot/main directory, the program needs some QT libraries to display to the TV (DIRECTFB), add environment variables (can be written as script execution, and then use the source qtenv.sh command to make the environment variable effective, echo $ to see if the variable is set successfully

Export qtdir=/

Export Qt_plugin_path= $QTDIR/plugins/

Export Ld_library_path= $QTDIR/lib:/usr/lib:/usr/local/lib:/mnt/ubi_boot/main

Then execute the program./executable file name-qws-display DIRECTFB

QTE4.6 transplant and related parameter introduction

http://blog.csdn.net/songjinshi/article/details/6554346

Development environment of QT Embedded-linux 4.5.2+arm transplant system

http://hi.baidu.com/deep_pro/item/fe01ecbd3fddc3d684dd7943

Appendix

Qt Configure parameter Description (Chinese)

http://blog.csdn.net/mociml/article/details/5317592

Building Qt

Http://processors.wiki.ti.com/index.php/Building_Qt

Qt4.7.4 under separate compilation Qtwebkit

Http://blog.sina.com.cn/s/blog_8738908f0100u84l.html

Ubuntu12.04 configuration installation Qt4.6.3 and porting to the mini2440 Development Board and its use of the whole process

http://blog.csdn.net/mybelief321/article/details/10137993

Http://www.quweiji.com/qt%E5%9C%A8%E5%90%84%E5%B9%B3%E5%8F%B0%E4%B8%8A%E7%9A%84%E6%90%AD%E5%BB%BAqt-everywhere/

QT builds on each platform Qt-everywhere

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.