OpenCV3.4 error: 'time' was not declared in this scope

  1. 编译环境Windows
  2. 目标编译平台Windows
  3. 编译工具Mingw5.3
  4. 报错文件test_hdr.cpp
  5. 报错行140 6.报错原因 时间函数未定义
srand(static_cast<unsigned>(time(0)));

在头部引用一下

#include <sys/time.h>

即可

猜你喜欢

转载自my.oschina.net/VenusV/blog/1650307