سلام دوستان
ممنون از مطالب آموزشی جالبتون.
من قبلا توی Kubuntu 9.04 به راحتی هر تمرین Qt رو کامپایل میکردم. اما حالا نمیدونم چرا error میگیرم !
البته من فقط qt4-designer رو نصب کردم ( چیز دیگهیی هم لازمه ؟! چون خودش qt-qmake رو هم نصب میکنه )
مثلا همین کد ساده که در صفحهی اول هست :
#include <QApplication>
#include <Qwidget>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget window;
window.resize(250, 150);
window.setWindowTitle("Simple example");
window.show();
return app.exec();
}
این خطا رو میگیرم ( البته بعد از qmake -project و qmake hello.pro و make )
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecslinux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o hello.o hllo.cpp
hello.cpp:1:24: error: QApplication: No such file or directory
hello.cpp:2:19: error: Qwidget: 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: ‘QWidget’ was not declared in this scope
hello.cpp:7: error: expected ‘;’ before ‘window’
hello.cpp:8: error: ‘window’ was not declared in this scope
hello.cpp:11: error: ‘app’ was not declared in this scope
hello.cpp: At global scope:
hello.cpp:4: warning: unused parameter ‘argc’
hello.cpp:4: warning: unused parameter ‘argv’
make: *** [hello.o] Error 1
اگه میشه راهنمایی بفرمایید.
ممنون