声明: //Test.h #include <thread> extern thread_local int id; 定义 #include "Test.h" thread_local int id= 0;