Qapplication: no such file or directory in Windows

Source: Internet
Author: User
Recently, the latest Windows installation package of qt5.0.1 was installed in Windows 7, You can go to the official QT website http://qt-project.org/downloads. This plugin integrates the qt5.0.1library into mingw4.7compiler into QT creator 2.6.2, which seems to solve the problem that QT creator could not normally use the mingw compiler. After downloading, It will be OK by default, but after installation, there will actually be a 3.68g file, much more than vs2012. Test helloworld Program First, open the menu [file]> [new file or project] (or press Ctrl + n) in QT creator ), select another project> Empty QT project, name it helloworld, and add a helloworld to the project. the C ++ source file of CPP.

Helloworld. cppCodeAs follows:

# Include <qapplication> # include <qpushbutton> # include <qlabel> # include <qhboxlayout> int main (INT argc, char ** argv) {qapplication app (argc, argv ); qwidget * pmainwidget = new qwidget; qhboxlayout * pboxlayout = new qhboxlayout; qlabel * plabel = new qlabel (pmainwidget); plabel-> settext ("Hello world! "); Qpushbutton * pquitbutton = new qpushbutton (pmainwidget); pquitbutton-> settext (" Quit QT! "); Pboxlayout-> addwidget (plabel); pboxlayout-> addwidget (pquitbutton); qsize windowsize (300,200); pmainwidget-> resize (windowsize); pmainwidget-> show (); qobject: connect (pquitbutton, signal (clicked (), pmainwidget, slot (close (); Return app.exe C ();}

The following error occurs after running: qapplication: no such file or directory. It is estimated that the library file corresponding to the corresponding qapplication cannot be found.

 
I checked through the Internet, basically all of which are solutions for Linux Ubuntu and other versions, as shown in the following csdn blog: Ghost:
Http://blog.sina.com.cn/s/blog_9da24f3b0101epan.html
 
Solution: add a line of QT ++ = widgets to the helloworld. Pro project file, and then compile and run it.

 

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.