【发布时间】:2017-03-22 12:31:49
【问题描述】:
我想在macos上编译如下代码:
struct timeval tv;
int retval = gettimeofday (&tv, NULL);
if (retval == 0)
TIMEVAL_TO_TIMESPEC (&tv, tp); //here I am getting the error
return retval;
但我得到了错误
错误:“TIMEVAL_TO_TIMESPEC”未在此范围内声明
TIMEVAL_TO_TIMESPEC (&tv, tp);
我正在使用 android 的交叉编译器进行编译。我尝试明确包含 time.h 标头,但仍然找不到 TIMEVAL_TO_TIMESPEC。如何正确编译这段代码?
【问题讨论】:
-
TIMEVAL_TO_TIMESPEC看起来像是一个 unix 宏。
标签: c++ macos cross-compiling timeval