سلام. من امروز کار با qt رو شروع کردم برای آموزش از سایت لینوکس رویو کمک گرفتم اما در اولین برنامه که کدش این بود
#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();
}
در موقع دستور make این ارور زیر رو گرفتم و فایل اجرایی ساخته نشد.لطفا کمک کنید.
tireng@tireng-PC:~/Documents/QT/1$ make
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I. -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -o main.o main.cpp
main.cpp:1:10: error: #include expects "FILENAME" or <FILENAME>
#include <QApplication>
^
main.cpp:2:10: error: #include expects "FILENAME" or <FILENAME>
#include <QWidget>
^
main.cpp: In function ‘int main(int, char**)’:
main.cpp:6:1: error: ‘QApplication’ was not declared in this scope
QApplication app(argc, argv);
^
main.cpp:8:1: error: ‘QWidget’ was not declared in this scope
QWidget window;
^
main.cpp:10:1: error: ‘window’ was not declared in this scope
window.resize(250, 150);
^
main.cpp:11:24: error: ‘quot’ was not declared in this scope
window.setWindowTitle("Simple example");
^
main.cpp:11:29: error: ‘Simple’ was not declared in this scope
window.setWindowTitle("Simple example");
^
main.cpp:11:49: error: expected primary-expression before ‘)’ token
window.setWindowTitle("Simple example");
^
main.cpp:14:8: error: ‘app’ was not declared in this scope
return app.exec();
^
main.cpp: At global scope:
main.cpp:4:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
int main(int argc, char *argv[])
^
main.cpp:4:31: warning: unused parameter ‘argv’ [-Wunused-parameter]
int main(int argc, char *argv[])
^
Makefile:306: recipe for target 'main.o' failed
make: *** [main.o] Error 1