Qt4.8.5 configuration problems

Source: Internet
Author: User

In my spare time, I want to take a look at QT. During the installation and compilation process, I encountered something worth recording. Let's summarize it.

(1) Installation

1、first install compiling environment qt-creator-win-opensource-3.0.0.exe, use the default path c: \ QT \ qtcreator-3.0.0

2. decompress the compilation tool mingw-gcc1__1.zip and copy the mingw folder to the path c: \ QT \ mingw.

3、uncompressor tool qtcreator-gdb-7.4-mingw32_nt-6.1-i686.tar.gz, copy the folder qtcreator-gdb-7.4-MINGW32_NT-6.1-i686 to the path c: \ QT \ qtcreator-gdb-7.4-MINGW32_NT-6.1-i686

4、installation library file qt-win-opensource-4.8.5-mingw.exe. When the installation prompt "find installed mingw" is displayed, it points to the path c: \ QT \ mingw.

5. After completing the above operations, execute the QT creator to perform the following Configuration:

(1) Tools-> options-> build and run-> QT version-> manual settings, add qmake path c: \ QT \ 4.8.5 \ bin \ qmake.exe

(2) Tools-> options-> build and run-> build kit (KIT), select compiler as "mingw", debugger select qtcreator-gdb-7.4-MINGW32_NT-6.1-i686, debugger select as C: \ QT \ qtcreator-gdb-7.4-MINGW32_NT-6.1-i686 \ gdb-i686-pc-mingw32.exe, QT version selected as "QT 4.8.5 (4.8.5 _ mingw )"

(3) Tools-> options-> build and run-> compiler-> manual settings, add mingw, and set the compiler path c: \ QT \ mingw \ bin \ gcc.exe

The above completes the installation of qt4.8.5.

(2) First Program

1. Create a new project:

Start QT creator, create a new project helloworld, and choose "file"> New file or project...> projects> Empty qt4 project> OK.

2. Create a new file:

Right-click the project name helloworld, add new... -> under C ++, select C ++ source file and click "OK"-> input class name hello and click "Next"-> finish

3. Enter the code:

#include <QApplication>  #include <QLabel>  int main(int argc,char *argv[])  {          QApplication app(argc,argv);          QLabel *label = new QLabel("Hello Qt!");          label->show();          return app.exec();  }  
4. After compilation, we can see the hello QT greeting, which indicates that our environment is correct.

(3) Small Problems

1. the EXE file will be generated in the debug or release directory. During execution, the system prompts us: "mingwm10.dll is not found, so this program cannot be started. "Re-installing the application may fix this problem ."

To solve this disgusting problem, we need to modify the environment variable by adding c: \ QT \ 4.8.5 \ bin; C: \ QT \ mingw \ bin in the path.

2. the EXE file generated by the local machine cannot be executed on other machines. The system prompts that no solution has been found for the DLL missing problem. If you know it, please let me know. Thank you!




Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.