运行时出现构建错误:
vapor build --mysql
在他们的 [网站] [1] 中没有太多关于如何为此项目安装任何依赖项的文档。从堆栈跟踪来看,我似乎缺少“lmysqlclient”,我不确定我是否应该添加到链接器标志中,或者这是需要添加到蒸汽配置中的东西(我对蒸汽很陌生)。
这是堆栈跟踪:
computer:Server user$ swift build -Xswiftc -I/usr/local/mysql/include -Xlinker -L/usr/local/mysql/lib -Xswiftc -DNOJSON
Linking CLibreSSL
Compile Swift Module 'TurnstileCrypto' (3 sources)
Compile Swift Module 'Jay' (21 sources)
Compile Swift Module 'SocksCore' (14 sources)
Compile Swift Module 'Polymorphic' (2 sources)
Compile Swift Module 'PathIndexable' (2 sources)
Compile Swift Module 'libc' (1 sources)
Compile Swift Module 'Core' (28 sources)
ld: warning: directory not found for option '-L/usr/local/mysql/lib'
Compile Swift Module 'Node' (22 sources)
Compile Swift Module 'Socks' (5 sources)
Compile Swift Module 'Fluent' (35 sources)
Compile Swift Module 'Essentials' (2 sources)
Compile Swift Module 'TLS' (7 sources)
Compile Swift Module 'Console' (34 sources)
Compile Swift Module 'Leaf' (34 sources)
Compile Swift Module 'JSON' (8 sources)
Compile Swift Module 'Turnstile' (13 sources)
Compile Swift Module 'Random' (3 sources)
Compile Swift Module 'Cipher' (2 sources)
Compile Swift Module 'MySQL' (10 sources)
Compile Swift Module 'TurnstileWeb' (8 sources)
Compile Swift Module 'BCrypt' (1 sources)
Compile Swift Module 'Hash' (3 sources)
Compile Swift Module 'HMAC' (2 sources)
Compile Swift Module 'FluentMySQL' (2 sources)
Compile Swift Module 'URI' (10 sources)
Compile Swift Module 'Transport' (8 sources)
Compile Swift Module 'HTTP' (33 sources)
Compile Swift Module 'SMTP' (21 sources)
Compile Swift Module 'WebSockets' (14 sources)
Compile Swift Module 'Settings' (10 sources)
Compile Swift Module 'Cookies' (11 sources)
Compile Swift Module 'Cache' (3 sources)
Compile Swift Module 'Routing' (9 sources)
Compile Swift Module 'HTTPRouting' (5 sources)
Compile Swift Module 'Sessions' (6 sources)
Compile Swift Module 'Auth' (14 sources)
Compile Swift Module 'TypeSafeRouting' (3 sources)
Compile Swift Module 'Vapor' (86 sources)
Compile Swift Module 'VaporMySQL' (1 sources)
Compile Swift Module 'App' (3 sources)
Linking ./.build/debug/App
ld: warning: directory not found for option '-L/usr/local/mysql/lib'
ld: library not found for -lmysqlclient for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: build had 1 command failures
error: exit(1): /Applications/Xcode/10.0/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/user/test/Server/.build/debug.yaml