求助,有关vscode编译错误
  • 板块灌水区
  • 楼主一只大龙猫
  • 当前回复13
  • 已保存回复13
  • 发布时间2021/11/21 16:17
  • 上次更新2023/11/3 23:49:09
查看原帖
求助,有关vscode编译错误
511907
一只大龙猫楼主2021/11/21 16:17

RT,在编译这里的代码时,出现了一个令人疑惑的编译错误:

出问题的代码:

void DoAiAndMap(){
	thread aiThread(AiDecide);
	thread uiThread(PrintMap);
	aiThread.join();
	uiThread.join();
} 

显示:

a.cpp: In function 'void DoAiAndMap()':
a.cpp:515:2: error: 'thread' was not declared in this scope
  thread aiThread(AiDecide);
  ^
a.cpp:516:9: error: expected ';' before 'uiThread'
  thread uiThread(PrintMap);
         ^
a.cpp:517:2: error: 'aiThread' was not declared in this scope
  aiThread.join();
  ^
a.cpp:518:2: error: 'uiThread' was not declared in this scope
  uiThread.join();
  ^

但是这里加了分号啊QAQ

2021/11/21 16:17
加载中...