ntfs-3g MacOS High Sierra 10.13.1 brew编译失败解决方案

升级10.13.1之后 ntfs-3g brew 安装失败,会有以下提示:


Last 15 lines from /Users/dany/Library/Logs/Homebrew/ntfs-3g/02.make:

clang -DHAVE_CONFIG_H -I. -I..     -DFUSE_USE_VERSION=26 -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -I../include/ntfs-3g -DPLUGIN_DIR=\"/usr/local/Cellar/ntfs-3g/2017.3.23/lib/ntfs-3g\" -g -O2 -Wall -c -o lowntfs_3g-lowntfs-3g.o `test -f 'lowntfs-3g.c' || echo './'`lowntfs-3g.c

clang -DHAVE_CONFIG_H -I. -I..     -DFUSE_USE_VERSION=26 -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -I../include/ntfs-3g -DPLUGIN_DIR=\"/usr/local/Cellar/ntfs-3g/2017.3.23/lib/ntfs-3g\" -g -O2 -Wall -c -o lowntfs_3g-ntfs-3g_common.o `test -f 'ntfs-3g_common.c' || echo './'`ntfs-3g_common.c

/bin/sh ../libtool  --tag=CC   --mode=link clang  -I../include/ntfs-3g -g -O2 -Wall  -lintl -framework CoreFoundation -o ntfs-3g.probe ntfs_3g_probe-ntfs-3g.probe.o ../libntfs-3g/libntfs-3g.la -lc 

lowntfs-3g.c:1932:29: error: no member named 'st_atim' in 'struct stat'

                                                = timespec2ntfs(stin->st_atim);

                                                                ~~~~  ^

lowntfs-3g.c:1938:29: error: no member named 'st_mtim' in 'struct stat'

                                                = timespec2ntfs(stin->st_mtim);

                                                                ~~~~  ^

2 errors generated.


找一下这个stat的定义:

find /Applications/Xcode.app/ -name "stat.h"

/Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stat.h 

发现这个结构是修改了:





struct stat {

dev_t st_dev; /* [XSI] ID of device containing file */

ino_t   st_ino; /* [XSI] File serial number */

mode_t st_mode; /* [XSI] Mode of file (see below) */

nlink_t st_nlink; /* [XSI] Number of hard links */

uid_t st_uid; /* [XSI] User ID of the file */

gid_t st_gid; /* [XSI] Group ID of the file */

dev_t st_rdev; /* [XSI] Device ID */

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)

struct timespec st_atimespec; /* time of last access */

struct timespec st_mtimespec; /* time of last data modification */

struct timespec st_ctimespec; /* time of last status change */

#else

time_t st_atime; /* [XSI] Time of last access */

long st_atimensec; /* nsec of last access */

time_t st_mtime; /* [XSI] Last data modification time */

long st_mtimensec; /* last data modification nsec */

time_t st_ctime; /* [XSI] Time of last status change */

long st_ctimensec; /* nsec of last status change */

#endif

off_t st_size; /* [XSI] file size, in bytes */

blkcnt_t st_blocks; /* [XSI] blocks allocated for file */

blksize_t st_blksize; /* [XSI] optimal blocksize for I/O */

__uint32_t st_flags; /* user defined flags for file */

__uint32_t st_gen; /* file generation number */

__int32_t st_lspare; /* RESERVED: DO NOT USE! */

__int64_t st_qspare[2]; /* RESERVED: DO NOT USE! */

};


应该就是 st_atimensec和st_mtimensec了,
cd /Users/you/Library/Caches/Homebrew

ntfs-3g-2017.3.23.tgz解压出来, 


修改一下lowntfs-3g.c:
加一行在这两句前面

#define _DARWIN_C_SOURCE

把 

stin->st_atim 和

stin->st_mtim 修成上面两个的名字,



./configure --prefix=/usr/local/Cellar/ntfs-3g/2017.3.23 --exec-prefix=/usr/

make 

sudo make install 


解决问题



  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值