详细报错信息:
‘gettimeofday’ was not declared in this scope xxx.cpp
在引用time.h的时候,要引用sys下的time.h:
一开始引用的time.h:
#include <time.h>
应改成引用sys/time.h:
#include <sys/time.h>