按照官网的指点,安装了QT
On Linux/Unix, you need to make the file executable in order to run it. You can either do this with your desktop's file manager or, at the command line, type:
chmod u+x qt-sdk-linux-x86-opensource-2009.03.1.bin
You should now be able to execute the file as normal. You can do this from the command line by typing:
./qt-sdk-linux-x86-opensource-2009.03.1.bin
只有在QT creator里面用以下程序测试:
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
报错
在compile output里 信息如下:
Running build steps for project hello...
Configuration unchanged, skipping QMake step.
Starting: /usr/bin/make -w
make: Entering directory `/root/hello'
g++ -o hello hello.o main.o mainwindow.o moc_mainwindow.o -L/opt/qtsdk-2009.03/qt/lib -lqt-mt -lXext -lX11 -lm
main.o: In function `main':
/opt/qtsdk-2009.03/qt/include/QtGui/qwidget.h:473: multiple definition of `main'
hello.o:/root/hello/hello.cpp:3: first defined here
/usr/bin/ld: Warning: size of symbol `main' changed from 287 in hello.o to 184 in main.o
/usr/bin/ld: cannot find -lqt-mt
collect2: ld returned 1 exit status
make: Leaving directory `/root/hello'
make: *** [hello] Error 1
Exited with code 2.
Error while building project hello
When executing build step 'Make'
在网上查了下,说 【打开你项目文件下底下的Makefile文件,找到CFLAG:开头的这行,删除 "-lgthread-2.0",就可以了】
但我在我的makefile里面找不到lgthread-2.0
································
请问该如何解决?