【发布时间】:2014-12-29 09:54:53
【问题描述】:
我开始在Qt中学习C++11标准中的线程。我不能包含库,没有这样的目录例如,我有以下简单代码:
#include <QCoreApplication>
#include <thread>
#include <iostream>
using namespace std;
void func();
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
MyThread th1;
th1.run();
return a.exec();
}
void func()
{
cout << "This string from thread!"<<endl;
}
在代码的第二个字符串上,我有一个错误。编译器没有“看到”,我知道我必须“包含”11 标准,所以我转到 .pro 并粘贴 CONFIG += c++11,但这对我没有帮助:C 拜托,我需要你的帮助!
【问题讨论】:
-
你遇到了什么错误?
标签: c++ qt c++11 boost-thread