操作系统:Mac OS X 10.8.4
编译器: g ++ 4.1
实用程序:下载为Xcode开发工具
我正在尝试使用g ++ 4.1重新编译在某些Linux系统(不确定是哪个)上编写的.cpp程序。我试图在OS X中重新编译它的g ++ 4.1。
问题是有些声明使用类型__time_t,例如:
__time_t lastDataRx;
__time_t lastHealthSent;
__time_t lasterrorsent;
导致错误,如:
"error: ‘__time_t’ was not declared in this scope"
包含的头文件是:
#include <stdio.h>
#include <sys/time.h>
#include <signal.h>
#include <getopt.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include "accel.h"
#include <arpa/inet.h>
我认为__time_t将在<sys/time.h>
中定义,但由此产生的错误似乎与我相矛盾。
类似的问题,但可能不适用: time not declared in scope, how do I find which includes a file uses?