Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error: could not build module 'Darwin'

Tags:

macos

swift

vapor

I'm new to vapor and I just installed in on MacOS, I'm getting following error when I build it. Does anyone know how to fix it? I've searched but most of the solution mentioned are for iOS rather than 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
like image 778
Raymond Avatar asked Oct 18 '19 21:10

Raymond


1 Answers

Uninstall MacPorts - it installs header files where they shouldn’t be and the compiler uses those header files rather than the ones bundled with Xcode

like image 171
0xTim Avatar answered Nov 14 '22 16:11

0xTim