尝试从qt开始然而我不能“制造”这个简单的例子

时间:2014-01-21 07:12:11

标签: c++ qt

今天我想第一次尝试qt并遵循本指南:" http://qt-project.org/doc/qt-4.8/gettingstartedqt.html"

然后在第一个代码示例中,我试图做同样的事情。这是一个例子:

#include <QApplication>
#include <QTextEdit>

int main(int argv, char **args)
{
    QApplication app(argv, args);

    QTextEdit textEdit;
    textEdit.show();
    return app.exec();
}

好吧,我直接没有包含QApplication和QTextEdit。所以我将其替换为文件的路径(/ usr / include / qt / QtGui / QApplication)。然后我收到了这个错误:

g++ -c -pipe -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/qt/mkspecs/linux-g++ -I. -I. -I/usr/include/qt -I/usr/include/qt/QtGui -I/usr/include/qt/QtCore -I. -o test.o test.cpp
In file included from /usr/include/qt4/QtGui/QTextEdit:1:0,
                 from test.cpp:2:
/usr/include/qt4/QtGui/qtextedit.h:45:39: grave Error occured: QtGui/qabstractscrollarea.h: File or directory not found.
 #include <QtGui/qabstractscrollarea.h>
                                       ^
compilation finished.
Makefile:728: recipe for target 'test.o' failed
make: *** [test.o] Error 1

知道我应该做什么吗?

提前感谢您的任何答案!

编辑:我完全忘记了部分错误信息是德语 - 修正了

Edit2:在QtCreator中它可以正常工作,但不能在命令行上运行,我很乐意这样做!

0 个答案:

没有答案