当我在QtCreator上执行以下命令时,我确实看到
hello world
印在屏幕上。但是如果我从终端执行
open project.app
主.cpp
#include <QCoreApplication>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
qDebug() << "hello world";
return a.exec();
}
项目.pro
QT += core
CONFIG += c++11 console app_bundle
SOURCES += main.cpp
我尝试了以下操作,但似乎还存在其他问题:
$ ./project.app/Contents/MacOS/project
dyld: Library not loaded: @rpath/QtWidgets.framework/Versions/5/QtWidgets
Referenced from: /Users/user/QtProjecs/project/./project.app/Contents/MacOS/project
Reason: Incompatible library version: project requires version 5.13.0 or later, but QtWidgets provides version 5.7.0
Abort trap: 6