Cross-compile a QT application-general Linux technology-Linux programming and kernel information. The following is a detailed description. On the Internet and in the group, some friends often get confused about how to port an application on an X86 host to the board. They only know how to port Qtopia, how can I add an application to qtopia ?? To this end, I wrote a little bit of my work experience, hoping to help beginners who were once as confused as I was, and hope to get everyone's corrections,
First, we have to perform cross-Compilation of the program we adjusted on the X86 machine, if it fails on the X86 machine .. So you don't need to compile it in a way that doesn't work. (it must be okay). Let's go to the topic and set the environment variables. We can use echo to view the environment variables, echo $ TMAKEPATH, if not... for the characters of/qws/linux-arm-g ++, We must reset them,
Export TMAKEPATH =/tmake installation path/qws/linux-arm-g ++. At the same time, QTDIR must specify the installation path of QTE as follows:
Export QTDIR =.../qt-2.3.7
After the preceding environment is set, we can use tmake to generate Makefile. Note that we use tmake instead of qmake. The tmake tool is in the tmake package. For more information, run the following command:
Tmake-o Makefile project name. pro
In this way, we will generate a new Makefile file. Next, we will open this file and make some small modifications.
1. Change LINK = arm-linux-gcc to LINK = arm-linux-g ++.
2: Change the LIBS =$ (SUBLIBS)-L $ (QTDIR)/lib-lm-lqte statement:
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.