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.