0
你好我正在用QT Creator發生編譯錯誤,我想知道是否有人知道爲什麼會出現這些錯誤。由於QT Creator出錯
main.cpp中:
#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:
#-------------------------------------------------
#
# 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 +=
編譯輸出:
Error while building/deploying project mygame (kit: Desktop Qt 5.8.0 MSVC2015_64bit)
When executing step "qmake"
我沒有確定是什麼讓這些錯誤(單詞和更多的單詞更詳細,所以「看起來你的文章需要更多的細節」將消失...它不會消失,所以我會繼續打字,直到它選擇這樣做,但看起來它不會很快。我們去了)。
這不是一個非常有用的問題標題。 – MrEricSir