QT Creator installs MinGW 32bit compiler under Windows

Preface

  Note: This author is based on the development needs of FFmpeg, so the MinGW 32bit compiler is installed in QT Creator under Windows! Other types of compilers can basically be implemented by referring to this article!

1. Download the required compiler

1. Download link

Link:

链接:https://pan.baidu.com/s/19kAZgNhhwGpK-_KHdq6TGg 
提取码:v6db
2. Downloaded files (the Qt path contains: 5.12.0 files and Tools files):

Insert image description here

2. Copy the downloaded compiled file to the corresponding location of the QT Creator installation path

1. Copy: Qt/Tools/mingw730_32 to the Tools file in the QT Creator installation path

Insert image description here
Insert image description here

2. Copy: Qt/5.12.0/mingw73_32 to the 5.12.4 file in the QT Creator installation path

Insert image description here

3. 3. Add QTCreator_Windows/Tools/mingw730_32/bin under the QT Creator installation path to the system environment variable Path

Insert image description hereInsert image description here

4. Add QTCreator_Windows/5.12.4/mingw73_32/bin under the QT Creator installation path to the system environment variable Path

Insert image description hereInsert image description here

5. Add the specified compiler in QT Creator

1. Open QT Creator, click Tools (T), click Options (O), and the following screen will pop up:

Insert image description here
Insert image description here

2. Click Qt Versions, then click Add

Insert image description here

2.1. Paste: Qt %{Qt:Version} (mingw73_32) into the version name location:

Insert image description here

3. Click Compiler, then click Add (Note: Add 32bit MinGW version gcc and 32bit MinGW version g++)

Insert image description here
Insert image description here
Insert image description here
Insert image description here

4. Click Debuggers, click Add

Insert image description here
Insert image description here

5. Click Build Kit (Kit), select the previously installed compiler, and then click Clone. The purpose is to clone the previous compiler and then directly modify the relevant configuration.

Insert image description here
Insert image description here

5.1. Several places that need to be modified in the previous interface are as follows:

(1) Change the name
(2) Change the Compiler
(3) Change the Debuger
(4) Change the Qt version
As shown in the figure after modification:
Insert image description here

  ###########The compiler installation is now complete! #############

6. Create QT Creator and use the specified compiler to compile the QT project

1. An error occurs when compiling QT project

Namely:
  Qt platform plugin not found in "windows"
  This application cannot be started because no Qt platform plugin could be initialized. Reinstalling the application can resolve this issue.
Insert image description here

2. Solution
Note: There are many solutions on the Internet (for example: modifying environment variables, moving plugins dynamic libraries, etc.). The author has tried many, but has not been solved, so he tried another rare method.
Solution:

  Just specify the location of the compiler plugins used in the build kit in QT, as shown below:
Insert image description here

Running successfully:

Insert image description here

Guess you like

Origin blog.csdn.net/Mr_zhang1911116/article/details/132106350