In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to compile and test qt programs". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1 Qtcreator compiles the ARM architecture program directly
(1) first, we use the command "/ opt/Qt5.5.1/Tools/QtCreator/bin/qtcreator.sh" to open qt Creator. As shown in figure 1.1:
Insert a picture description here
(2) then we click file in the upper left corner, and then click open file or project. As shown in figure 1.2:
Insert a picture description here
(3) then we select the helloworld project we created earlier. Double-click to open the .pro file. As shown in figure 1.3:
Insert a picture description here
(5) then we enter the project. As shown in figure 1.5:
Insert a picture description here
(7) wait for the construction of the progress bar in the lower right corner to complete. Figure 1.7:
(9) all the files compiled and output by Qt Creator are in this folder. We use the command "cd build-helloworld-imx6-Debug", where we can see the generated executable file helloworld.
Insert a picture description here
(10) We can view the file information by using the command "file helloworld". As shown in figure 1.10:
Insert a picture description here
2 command line compiling QT program
(1) first, we use the command "cd / opt/Qtworkspace/helloworld/" to enter the project directory. As shown in figure 2.1:
Insert a picture description here
(2) then we use orders
"source / opt/fsl-imx-x11/4.1.15-2.1.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi" to add environment variables such as compilers. Figure 2.2:
Insert a picture description here
(3) then use the command "arm-poky-linux-gnueabi-g++-- version" to see the added compiler. As shown in figure 2.3:
Insert a picture description here
(4) then we use the command "qmake" to generate the Makefile file. Figure 2.4:
Insert a picture description here
(5) then use the command "make" to compile the program. Figure 2.5:
Insert a picture description here
(6) wait for the compilation to complete, and then use the command "ls" to see the generated qt program helloworld. Figure 2.6:
Insert a picture description here
3 run Helloworld
We connect the flash drive to the computer, and the flash drive will be automatically mounted to the corresponding directory under "/ media/topeet" (the following USB disk folder is the mount directory of the author's USB disk, note that different devices will vary), as shown in figure 3.1:
Insert a picture description here
Then click "eject" on the left taskbar to safely remove the USB drive device. As shown in figure 3.3:
Insert a picture description here
Then we start the development board, login name is root, no password, insert the U disk into the device usb port, the U disk will be mounted automatically. As shown in figure 3.4:
Insert a picture description here
Then we use the command "cd / run/media/sda1" to see the helloworld program. As shown in figure 3.5:
Insert a picture description here
Then use the command ". / helloworld" to run the program.
Insert a picture description here
Finally, we can see the program window and "hello world!" on the screen. Text display. As shown in figure 3.7:
Insert a picture description here
"Ctrl + C" can exit the program.
This is the end of "how to compile and test qt programs". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 282
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.