使用qmake编译时出错,qt?

时间:2016-06-07 06:46:20

标签: qt qmake

我尝试编写一个简单的qt应用程序,当我尝试编译它时出现此错误

#include <QApplication>
#include <QTextEdit>

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

    QTextEdit textEdit;
    textEdit.show();

    return app.exec();
}

_

qmake file.cpp

/home/j/qtf.cpp:4: Extra characters after test expression.
/home/j/qtf.cpp:6: Extra characters after test expression.
/home/j/qtf.cpp:8: Extra characters after test expression.
/home/j/qtf.cpp:11: Extra characters after test expression.

错误在哪里

1 个答案:

答案 0 :(得分:3)

为了编译您的应用程序,您必须:

  • 创建项目文件
  • 生成makefile,
  • 构建项目。

要执行这些步骤,只需调用相应的命令:

qmake -project (generates project file)
qmake          (generates makefile)
make           (build the project)