美文网首页
在Mac命令行下编译Qt5 helloworld

在Mac命令行下编译Qt5 helloworld

作者: Devest | 来源:发表于2018-02-04 13:03 被阅读0次
#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>
int main(int argc, char *argv[])
{
     QApplication app(argc, argv);
     QLabel label("hello world");
     label.show();
     return app.exec();
}

采用如下命令进行编译:

g++ -I/usr/local/opt/qt/include -std=c++11 -F/usr/local/opt/qt/lib 
-framework QtCore -framework QtWidgets -o helloworld main.cpp
程序运行截图

相关文章

网友评论

      本文标题:在Mac命令行下编译Qt5 helloworld

      本文链接:https://www.haomeiwen.com/subject/tojmzxtx.html