qt c语言头文件在哪,c – 不推荐在include / Qt中包含头文件

我最近开始使用Qt 4书进行C Gui编程.

但是,我无法通过第一个教程.

#include

#include

int main(int argv, char **args)

{

QApplication app(argv, args);

QTextEdit textEdit;

textEdit.show();

return app.exec();

}

每次我尝试编译它,我得到这个:

C:\Qt\4.8.0\andrew>qmake -project

C:\Qt\4.8.0\andrew>qmake

C:\Qt\4.8.0\andrew>make

mingw32-make -f Makefile.Debug

mingw32-make[1]: Entering directory `C:/Qt/4.8.0/andrew'

g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -

DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -

DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\includ

e\QtCore" -I"..\include\QtGui" -I"..\include" -I"." -I"..\include\ActiveQt" -I"d

ebug" -I"..\mkspecs\win32-g++" -o debug\tutone.o tutone.cpp

In file included from tutone.cpp:1:0:

C:\Qt\4.8.0\include\Qt\Qapplication.h:3:10: warning: #warning "Inclusion of head

er files from include/Qt is deprecated." [-Wcpp]

In file included from tutone.cpp:2:0:

C:\Qt\4.8.0\include\Qt\Qpushbutton.h:3:10: warning: #warning "Inclusion of heade

r files from include/Qt is deprecated." [-Wcpp]

tutone.cpp: In function 'int qMain(int, char**)':

tutone.cpp:11:7: error: 'class QApplication' has no member named 'setMainWidget'

mingw32-make[1]: *** [debug/tutone.o] Error 1

mingw32-make[1]: Leaving directory `C:/Qt/4.8.0/andrew'

mingw32-make: *** [debug] Error 2

由于我是Qt的新手并且对编译很新,我认为错误就在我的最后.我是否宣布标题错误或其他什么?

我的.pro文件如下所示:

######################################################################

# Automatically generated by qmake (2.01a) Thu Jan 19 12:41:21 2012

######################################################################

TEMPLATE = app

TARGET =

DEPENDPATH += .

INCLUDEPATH += .

# Input

HEADERS += tutone.h \

C:/Qt/4.8.0/include/Qt/Qapplication.h \

../include/QtGui/qapplication.h \

../src/gui/kernel/qapplication.h \

C:/Qt/4.8.0/include/Qt/Qpushbutton.h \

../include/QtGui/qpushbutton.h \

../src/gui/widgets/qpushbutton.h

SOURCES += tutone.cpp \

tutthree.cpp \

../src/gui/kernel/qapplication.cpp \

../src/gui/widgets/qpushbutton.cpp

谢谢

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值