Use eclipse (Version: 3.0.1compile to compile qtsettings (qt-win-opensource-4.1.0-mingw.exe)

Source: Internet
Author: User

Use eclipse (Version: 3.0.1compile to compile qtsettings (qt-win-opensource-4.1.0-mingw.exe)
(1) install eclipse and CDT
(2) create a managed make C ++ Project hello
(3) Add a source file main. cpp.
# Include <qtgui/qapplication>
# Include <qtgui/qpushbutton>

Int main (INT argc, char * argv [])
Qapplication app (argc, argv );

Qpushbutton Hello ("Hello world! ");
Hello. Resize (100, 30 );

Hello. Show ();
Return app.exe C ();

(4) In Project/properties, select the tool settings tab under C/C ++ build to set it:
Add C:/QT/4.1.0/include in gcc C ++ Compiler/Directories
Add qtcored4, qtguid4, and qtmaind to libraries (-l) in gcc C ++ linker/Libraries
(Note that it cannot be written as libqtguid4.a, libqtguid4.a, libqtmaind.)
View and add C:/QT/4.1.0/lib in library search path (-l)

(5) Run

Related Article

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