【问题标题】:fatal error: could not build module 'Darwin'致命错误:无法构建模块“达尔文”
【发布时间】:2019-10-18 21:38:36
【问题描述】:

我是 vapor 的新手,我刚刚安装在 MacOS 上,我在构建它时遇到了以下错误。有谁知道如何修理它?我已经搜索过,但提到的大多数解决方案都是针对 iOS 而不是 MacOS。

While building module 'Darwin' imported from /Users/imac1/ROOT/Vapor/Hello/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h:35:
In file included from <module-includes>:357:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/ncurses.h:141:
/opt/local/include/unctrl.h:60:63: error: unknown type name 'SCREEN'
NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype);
                                                              ^
/opt/local/include/unctrl.h:60:53: error: function cannot return function type 'char *(int *, chtype)' (aka 'char *(int *, unsigned int)')
NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype);
                                                    ^
/opt/local/include/unctrl.h:60:54: error: a parameter list without types is only allowed in a function definition
NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype);
                                                     ^
In file included from /Users/imac1/ROOT/Vapor/Hello/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/c_nio_http_parser.c:24:
/Users/imac1/ROOT/Vapor/Hello/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h:35:10: fatal error: could not build module 'Darwin'
#include <stddef.h>
 ~~~~~~~~^
4 errors generated.
[0/20] Compiling CNIOHTTPParser c_nio_http_parser.c
[1/20] Compiling CNIOLinux shim.c
[2/20] Compiling CNIOZlib empty.c
[3/20] Compiling CNIOLinux ifaddrs-android.c
[3/20] Compiling CNIOOpenSSL shims.c
[3/20] Compiling CNIOOpenSSL helpers.c
[3/20] Compiling CNIODarwin shim.c
[3/20] Compiling CNIOSHA1 c_nio_sha1.c

【问题讨论】:

    标签: swift macos vapor


    【解决方案1】:

    卸载 MacPorts - 它将头文件安装在不应该出现的位置,编译器使用这些头文件而不是 Xcode 捆绑的那些

    【讨论】:

      猜你喜欢
      • 2021-08-08
      • 1970-01-01
      • 2018-08-03
      • 2015-08-18
      • 1970-01-01
      • 2017-12-01
      • 2016-06-10
      • 2017-06-02
      • 1970-01-01
      相关资源
      最近更新 更多