管理提醒: 本帖被 kasim 从 Ubuntu技术交流区 移动到本区(2010-10-27)
我在ubuntu下面编译 *cpp工程,做qt开发时,提示找不到qvbox.h文件,怎么办?
#include <qapplication.h>
#include <qpushbutton.h>
#include <qfont.h>
#include <qvbox.h>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QVBox box;
box.resize( 200, 120 );
QPushButton quit( "Quit", &box );
quit.setFont( QFont( "Times", 18, QFont::Bold ) );
QObject::connect( &quit, SIGNAL(clicked()), &a, SLOT(quit()) );
a.setMainWidget( &box );
box.show();
return a.exec();
}
出错情况:
root@zxb:/home/zhangxiaobo/nfs/project/quit# make
arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../qt-arm/build/mkspecs/qws/linux-arm-g++ -I. -I../../../../qt-arm/build/include/QtCore -I../../../../qt-arm/build/include/QtNetwork -I../../../../qt-arm/build/include/QtGui -I../../../../qt-arm/build/include -I. -I. -o main.o main.cpp
main.cpp:4:19: 错误: qvbox.h:没有那个文件或目录
main.cpp: In function ‘int main(int, char**)’:
main.cpp:10: error: ‘QVBox’ was not declared in this scope
main.cpp:10: error: expected `;' before ‘box’
main.cpp:11: error: ‘box’ was not declared in this scope
main.cpp:18: error: ‘class QApplication’ has no member named ‘setMainWidget’
make: *** [main.o] 错误 1