外部自动变量没有初始值设定项 我需要在我的C++程序中使用一个全局时间戳(STD::HealO::HijyRealPosithCloth::No())。我在头文件header.h中声明了它: #include<chrono> using namespace std; extern auto start;

外部自动变量没有初始值设定项 我需要在我的C++程序中使用一个全局时间戳(STD::HealO::HijyRealPosithCloth::No())。我在头文件header.h中声明了它: #include<chrono> using namespace std; extern auto start;,c++,time,clock,C++,Time,Clock,谁能告诉我我做错了什么?谢谢 如何推断auto启动的类型? 您需要声明类型 extern std::chrono::high_resolution_clock::time_point start; 谢谢但是我得到了另一个错误:“在没有参数列表的情况下,模板名'std::chrono::time_point'的使用无效”,但是我检查了c++11手册,其中说std::chrono::time_point是高分辨率时钟的返回。那个么这个错误意味着什么呢?新问答的可能副本有更好的答案(而且问题更清晰)

谁能告诉我我做错了什么?谢谢

如何推断
auto
启动的类型?
您需要声明类型

extern std::chrono::high_resolution_clock::time_point start;

谢谢但是我得到了另一个错误:“在没有参数列表的情况下,模板名'std::chrono::time_point'的使用无效”,但是我检查了c++11手册,其中说std::chrono::time_point是高分辨率时钟的返回。那个么这个错误意味着什么呢?新问答的可能副本有更好的答案(而且问题更清晰)。
error: declaration of ‘auto start’ has no initializer
extern std::chrono::high_resolution_clock::time_point start;