わかりました...だから私はQtにとても慣れていません。Ubuntuディストリビューションにインストールしました。../helloworld/ ディレクトリにある次のファイル (helloworld.cpp) で動作するかどうかを確認するために、新しいテスト アプリケーションを作成しました。
/* helloworld.cpp */
#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
helloworld.pro ファイルを生成するために実行しました。次にqmake
、Makefile を生成するために実行しました。次にmake
、コンパイルするために実行し、次の出力/エラーを取得しました。
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG
-DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++-64 -I.
-I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4
-I. -I. -o helloworld.o helloworld.cpp
helloworld.cpp:1:24: fatal error: QApplication: No such file or directory
compilation terminated.
make: *** [helloworld.o] Error 1
helloworld.o ファイルが見つからないということです...どうすれば修正できますか? 別の議論が言ったように追加しようとしQT += webkit
ました...そしてそれもうまくいきませんでした。
そこにいるコードモンキーは、これを修正する方法を知っていますか??? よろしくお願いします!