Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Qt Application Development Framework under Linux

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "how to install Qt application development framework under Linux". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to install Qt application development framework under Linux" can help you solve the problem.

Qt is a cross-platform C++ graphical interface application framework. It provides developers with the functions needed to establish a graphical user interface, and is widely used in the development of GUI programs as well as non-GUI programs. Qt is easy to extend and allows real component programming.

1. Download Qt5 offline installation package

Download address: after http://www.qt.io/download-open-source/ enters, please note that there is a [View All Downloads] link at the bottom of the page, click it to find the offline installation package!

Select the corresponding installation package according to your operating system version:

2. Add execution permissions

After the download is completed, get the offline installation package, open "Terminal", enter the directory where the offline installation package is located, and then execute the command:

Sudo chmod + x qt-opensource-linux-x86-5.4.1.run

3. Start the installation

After you add execute permissions, you can start installing Qt5 and continue to run the command based on step 2:

Sudo. / qt-opensource-linux-x86-5.4.1.run

You can see the following window:

Next, follow the steps indicated by the number:

4. Configure environment variables

Execute the following command in Terminal:

Sudo gedit / etc/profile

Add the following: 32-bit system:

Export QTDIR=/opt/Qt5.4.1/5.4export PATH=$QTDIR/gcc/bin:$PATHexport LD_LIBRARY_PATH=$QTDIR/gcc/lib:$LD_LIBRARY_PATH

64-bit system:

Export QTDIR=/opt/Qt5.4.1/5.4export PATH=$QTDIR/gcc_64/bin:$PATHexport LD_LIBRARY_PATH=$QTDIR/gcc_64/lib:$LD_LIBRARY_PATH

Please change the above path against the installed version!

Save exit, execute the command: source / etc/profile to make the environment variable effective!

5. Verify that the installation is successful

Execute the command under the terminal: qmake-version

If the following message appears, the configuration installation is successful:

6. Test example

Open Qt Creator, click New Project, and create a new project:

7. Resolve errors

When you try to run, an error occurs:

According to the error prompt, we open the following interface:

The above error occurred because we did not install the available gcc + compiler (basically all linux distributions have their own gcc compiler). Execute the following command in the terminal:

Sudo apt-get install Group1

After the installation is complete, reopen Qt Creator and you can find that the compiler has been found:

Compile again:

You will find the following error:

This is because the GL library is not installed, so execute the command under the terminal:

Sudo apt-get install libgl1-mesa-dev

After the installation is complete, compile again, and it should be successful!

8, installation completed after the above steps, should be able to successfully compile and run the program, the whole installation process is over!

This is the end of the introduction to "how to install the Qt application development framework under Linux". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

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: 0

*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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report