Qt program in cygwin

Source: Internet
Author: User

Qt program in cygwin

From http://blog.sina.com.cn/s/blog_49366773010008c7.html

I have done QT on windows, so I also want to try the QT program under cygwin, but it is a pity that only qt3 is used.

To run the QT program, you also need to start xwindows. (The command to start X Window in cygwin is startx.)

# Include

<Qapplication. h>

# Include <qpushbutton. h>

Int main (INT argc, char ** argv)

{

Qapplication A (argc, argv );

Qpushbutton Hello ("Hello world! ", 0 );

Hello. Resize (100, 30 );

A. setmainwidget (& Hello );

Hello. Show ();

Return a.exe C ();

}

G ++ compilation instructions:

G ++ qt2.cpp-O qt2-I/usr/include/qt3-L/lib/qt3/lib-lqt

 

Notes:

I have never been very familiar with the G ++ switch. I don't know how to reference the non-standard G ++ header file directory,

The case sensitivity of the switch in G ++ has special meanings:-I indicates an include directory, and-I indicates the specific include file name;

-L indicates the directory of Lib, and-l indicates the name of link Lib.

 

You are welcome to share your cross-platform and C ++ knowledge with me.

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.