我正在尝试编译在MacOS下用Fortran / C for Linux编写的库。编译中止并显示以下消息:
copen.c:150:10: fatal error: 'sys/statfs.h' file not found
#include <sys/statfs.h>
^~~~~~~~~~~~~~
1 error generated.
make: *** [copen.o] Error 1
文件copen.c中有问题的部分是:
#include <sys/statfs.h>
此头文件显然在MacOS下不可用。我试图将上面的行替换为
#include <sys/param.h>
#include <sys/mount.h>
,似乎在MacOS下提供了相同的功能。但随后出现另一个错误:
copen.c:160:10: fatal error: 'sys/fstyp.h' file not found
#include <sys/fstyp.h>
^~~~~~~~~~~~~
1 error generated.
make: *** [copen.o] Error 1
由文件copen.c中的以下几行引起:
#if defined (_AIX)
#include <sys/statvfs.h>
#define FSTYPSZ 16
#elif defined(__linux__)
#include <sys/vfs.h>
#else
#include <sys/fstyp.h>
#include <sys/fsid.h>
#endif
是否可以通过替换某些包含头文件的行在MacOS下编译该库?还是有解决此问题的另一种方法?