nginx 1.20 版本编译报错

cc -c -pipe -O -Wall -Wextra -Wpointer-arith -Wconditional-uninitialized -Wno-unused-parameter -Wno-deprecated-declarations -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/os/unix/ngx_files.o \
src/os/unix/ngx_files.c
src/os/unix/ngx_files.c:404:9: error: 'pwritev' is only available on macOS 11.0 or newer [-Werror,-Wunguarded-availability-new]
n = pwritev(file->fd, vec->iovs, vec->count, offset);
^~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/uio.h:104:9: note: 'pwritev' has been marked as being introduced in macOS 11.0 here, but the deployment target is macOS 10.14.0
ssize_t pwritev(int, const struct iovec *, int, off_t) __DARWIN_NOCANCEL(pwritev) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));
^
src/os/unix/ngx_files.c:404:9: note: enclose 'pwritev' in a __builtin_available check to silence this warning
n = pwritev(file->fd, vec->iovs, vec->count, offset);
^~~~~~~
1 error generated.
make[1]: *** [objs/src/os/unix/ngx_files.o] Error 1
make: *** [build] Error 2


邀请回答
提问于 2021-06-02 16:00
103 次浏览
共2个回答

发表评论
  • 皮皮鲁
    2021-06-02 23:09

    src/os/unix/ngx_files.c:404:9: error: 'pwritev' is only available on macOS 11.0 or newer [-Werror,-Wunguarded-availability-new]
    n = pwritev(file->fd, vec->iovs, vec->count, offset);
    ^~~~~~~

     error: 'pwritev' is only available on macOS 11.0 or newer [


    是不是你的macos版本太低了?


    0
    回复
    举报
    • LEESING 2021-06-07 10:47

      我的操作系统是最新版的

      0
      回复
      举报
    • LEESING 2021-06-07 10:48


      0
      回复
      举报
  • LEESING
    2021-06-02 16:02

    使用操作系统是macos 11.4

    0
    回复
    举报
提问者

LEESING

我就是我

  • 0

    文章

  • 0

    粉丝

  • 1

    被赞

LEESING
按Enter键发送
您已邀请位用户
版权所有©F5 Networks,Inc.保留所有权利。京ICP备16013763号-5