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

What is the method of installing qt in Linux

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

Share

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

This article mainly explains "what is the method of installing qt in Linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the method of installing qt in Linux"?

Qt is a faster and smarter way to create innovative devices, modern user interfaces, and applications for multiple screens. It is a cross-platform C++ application development framework.

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

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

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/profile1

Add the following: 32-bit system:

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

two

three

64-bit system:

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

two

three

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-dev1

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!

At this point, I believe you have a deeper understanding of "what is the method of installing qt in Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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