首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >QT Creator错误

QT Creator错误
EN

Stack Overflow用户
提问于 2017-05-03 19:55:54
回答 1查看 553关注 0票数 0

你好,我有QT的构建错误,我想知道是否有人知道它为什么会犯这些错误。谢谢

main.cpp:

代码语言:javascript
复制
#include <QApplication>
#include <QGraphicsScene>
#include <QGraphicsRectItem>
#include <QGraphicsView>


int main(int argc, char *argv[]){

    QApplication a(argc, argv);

    //Create Scene
    QGraphicsScene * scene = new QGraphicsScene();

    //Creat Item To Put Into Scene
    QGraphicsRectItem * rect = new QGraphicsRectItem();
    rect->setRect(100, 50, 100, 100);

    //Add Item To Scene aka buffer
    scene->addItem(rect);

    //add a view
    QGraphicsView * view = new QGraphicsView(scene);
    view->show();

    return a.exec();
}

mygame.pro:

代码语言:javascript
复制
#-------------------------------------------------
#
# Project created by QtCreator 2017-05-03T12:14:31
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = mygame
TEMPLATE = app

# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0


SOURCES += main.cpp

HEADERS  +=

编译输出:

代码语言:javascript
复制
Error while building/deploying project mygame (kit: Desktop Qt 5.8.0 MSVC2015_64bit)
When executing step "qmake"

我不知道是什么造成了这些错误(单词和更多的文字更详细,所以“看起来你的帖子需要更多的细节”将消失……它不会消失,所以我将继续打字,直到它选择这样做,但看起来它不会马上去。就这样吧)。

EN

回答 1

Stack Overflow用户

发布于 2017-05-03 20:41:54

查看编译输出选项卡。如果需要,还可以在命令提示符上运行qmake。

另一种修复奇怪的qmake错误的有用方法是在Qt中获得一个新的项目设置。

关闭Qt,删除.pro.user文件,并使用项目重新打开Qt。这将迫使您重新配置您的Qt版本的调试/发布等项目。

希望这能有所帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43768895

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档