ホームディレクトリにqt-everywhere-opensource-src-4.8.2というディレクトリがあります。このディレクトリには基本的なQTパッケージが含まれていますが、問題は、ホームディレクトリにある通常のQtファイルをコンパイルすると、それぞれのQTパッケージが見つからないというエラーが表示されることです。ただし、通常のcファイルをコンパイルしようとするとgccおよびg++によるc++ファイルの場合、エラーは発生しません。私が欲しいのは、ディレクトリに存在するパッケージをどのように含めることができるかを知ることです。私がコンパイルしようとしている私のファイルは:-
#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();
}
エラー=
demo.cpp:1:24: error: QApplication: No such file or directory
demo.cpp:2:19: error: QWidget: No such file or directory
demo.cpp: In function âint main(int, char**)â:
demo.cpp:6: error: âQApplicationâ was not declared in this scope
demo.cpp:6: error: expected â;â before âappâ
demo.cpp:8: error: âQWidgetâ was not declared in this scope
demo.cpp:8: error: expected â;â before âwindowâ
demo.cpp:10: error: âwindowâ was not declared in this scope
demo.cpp:14: error: âappâ was not declared in this scope