我加了那句之后,出现以下错误,我是初学者,谁能帮我看看
g++ -c -O2 -fno-strength-reduce -I/usr/lib/qt-3.1/include -I/include -o helloworld.o helloworld.cpp
helloworld.cpp: In function `int main(int, char**)':
helloworld.cpp:9: no method `QTextCodec::codecForLocale'
helloworld.cpp:9: no method `QTextCodec::setCodecForLocale'
make: *** [helloworld.o] Error 1
源代码是:
/* helloworld.cpp */
#include <qapplication.h>
#include <qlabel.h>
#include <qstring.h>
int main(int argc,char **argv)
{
QApplication app(argc,argv);
QTextCodec::setCodecForLocale(QTextCodec:: codecForLocale());
QLabel *label = new QLabel(NULL);
QString string("Hello, 中国");
label->setText(string);
label->setAlignment(
Qt::AlignVCenter | Qt::AlignHCenter);
label->setGeometry(0,0,180,75);
label->show();
app.setMainWidget(label);
return(app.exec());
}
要怎么改呢??