この単純なQtアプリケーションを作成していますが、次のエラーが表示されています。なぜこれらのエラーが発生するのか誰かに説明してもらえますか?以下はコードスニペットです。
#include <QTextStream>
int main()
{
QTextStream out(stdout);
out << "console application\n";
}
コンパイルするための手順:
qmake -project
qmake .pro file
make
上記の手順を実行した後、以下は私が得ている出力です:
g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3 -o text.o text.cpp
text.cpp:1:23: error: QTextStream: No such file or directory
text.cpp: In function ‘int main()’:
text.cpp:5: error: ‘QTextStream’ was not declared in this scope
text.cpp:5: error: expected ‘;’ before ‘out’
text.cpp:6: error: ‘out’ was not declared in this scope
make: *** [text.o] Error 1
プラットフォーム:Linux