薛定谔的thread头文件?
  • 板块灌水区
  • 楼主GoldenApple
  • 当前回复7
  • 已保存回复7
  • 发布时间2023/8/7 12:39
  • 上次更新2023/11/3 05:26:25
查看原帖
薛定谔的thread头文件?
951077
GoldenApple楼主2023/8/7 12:39

今天想弄个多线程玩玩,可是这编译器脑回路清奇

#include<cstdio>
#include<thread>
#include<stdlib.h>
using namespace std;
void threadA(){
	printf("Hello World!");
}
int main(){
	thread t(threadA);
}

本来应该是没事的,可是你猜编译器怎么说?

[Error] 'thread' was not declared in this scope
[Note] 'std::thread' is defined in header '<thread>'; did you forget to '#include <thread>'?

到底咋回事啊啊啊啊

2023/8/7 12:39
加载中...