在QT creator中点击 new project-》QT console application -》choose-》填写name和选定location--》一路next
将main.cpp的文档内容替换为一下内容
#include <QCoreApplication>
#include <QtDebug>
#include <QDir>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QString mStr = "hello,www.eepw.com.cn";
qDebug()<<mStr;
return a.exec();
}
这是点击qtcreator左侧的run按钮或者 CTRL+R 实现程序的编译,如果成功,则在ubuntu的terminal中显示
"hello,www.eepw.com.cn";
我要赚赏金
