Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

mingw

I am trying to compile Google test through MinGW via command line, but when I try to compile with command

gcc -I D:\gtest -I D:\gtest\include -I D:\gtest\include\gtest src\gtest_main.cc src\gtest-all.cc

it throws error

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

I successfully compiled through Visual Studio, so my guess it's not the fault in code. Does anyone else encountered this problem and knows solution?

like image 781
user2789353 Avatar asked Dec 31 '13 11:12

user2789353


1 Answers

<time.h> and <sys/time.h> are two different includes

like image 115
mp so Avatar answered Nov 08 '22 22:11

mp so