我按照c++ gui programing with qt4上的第一个例子写了hello qt,但是在最后make hellp的时候报错
g++ hello.cpp -o hello
hello.cpp:1:23: QApplication: No such file or directory
hello.cpp:2:17: QLabel: No such file or directory
hello.cpp: In function `int main(int, char**)':
hello.cpp:6: error: `QApplication' was not declared in this scope
hello.cpp:6: error: expected `;' before "app"
hello.cpp:7: error: `QLabel' was not declared in this scope
hello.cpp:7: error: `label' was not declared in this scope
hello.cpp:7: error: `QLabel' is not a type
hello.cpp:9: error: `app' was not declared in this scope
hello.cpp:10:2: warning: no newline at end of file
qt4.5,windows下用qmake编译的。自动生成的hello.pro里的内容是这样的:
######################################################################
# Automatically generated by qmake (2.01a) ??? ?? 25 21:04:21 2009
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
# Input
SOURCES += hello.cpp