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