我想在Qt Creator中创建一个简单的项目,但我无法运行它。
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel label("Hello, world");
label.show();
return app.exec();
}
这是我的.pro
#-------------------------------------------------
#
# Project created by QtCreator 2017-08-03T16:29:59
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Hello
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 \
mainwindow.cpp
HEADERS += \
mainwindow.h
我是qt的绝对新生,我只是按照互联网上的一些课程,所以我不知道它有什么问题。我的mac os:10.12.3。 Qt Creator:4.3.1基于Qt 5.9.1(Clang 7.0(Apple),64位)