Google 测试 Gtest.cc:812:错误:'gettimeofday' 未在此范围内声明

use*_*353 5 c++ mingw

我正在尝试通过命令行通过 MinGW 编译 Google 测试,但是当我尝试使用命令进行编译时

gcc -I D:\gtest -I D:\gtest\include -I D:\gtest\include\gtest src\gtest_main.cc src\gtest-all.cc
Run Code Online (Sandbox Code Playgroud)

它抛出错误

Gtest.cc:812: error: 'gettimeofday' was not declared in this scope

我通过 Visual Studio 成功编译,所以我猜这不是代码的错误。有没有其他人遇到过这个问题并知道解决方案?

mp *_* so 5

<time.h> and <sys/time.h> 是两个不同的包括