首次成功编译了使用QT4的程序,遇到如下2个问题。
1。出错:............. /bin/sh.exe: C:Qt4.0.0binmoc.exe: command not found
解:
when using qt build system with mingw, make sure you DO NOT HAVE sh.exe in
the PATH. Further make sure to use mingw32-make instead of msys's version.
This is the ONLY way to force make and qmake to use cmd.exe (at least the
only way I know) which is absolutely mandetory for this to work. When
writing your .pro files you can always use /'ses in the pathes.
2。出错:C:/Qt/4.0.1/include/QtGui/../../src/gui/painting/qcolor.h:31: error:
`QtValidLicenseForGuiModule' does not name a type
解:In the file C:\Qt.0.1\src\corelib\global\qconfig.h change the line 13
# define QT_EDITION QT_EDITION_
to
# define QT_EDITION QT_EDITION_DESKTOP
心得:使用qmake,可以大大减少劳动量,不用自己写makefile,不用考虑g++参数。