2017-04-04 56 views
0

當試圖通過包管理器安裝模板時,它會在我的項目導入模塊libxml2中抱怨一些現有的源文件。Swift包管理器(「Swift Build」)在xcode中編譯得很好

雖然庫正確鏈接並在xcode中編譯得很好。

有人能解釋我做錯了什麼嗎?

下面是我的控制檯輸出

MacBook-Pro:XCUI-ReportGen zaid$ swift build -Xcc -fblocks -Xswiftc -I/usr/local/include -Xlinker -L/usr/local/lib 
 
Fetching https://github.com/kylef/Stencil.git 
 
Fetching https://github.com/kylef/PathKit.git 
 
Fetching https://github.com/kylef/Spectre.git 
 
Cloning https://github.com/kylef/Spectre.git 
 
Resolving https://github.com/kylef/Spectre.git at 0.7.2 
 
Cloning https://github.com/kylef/Stencil.git 
 
Resolving https://github.com/kylef/Stencil.git at 0.8.0 
 
Cloning https://github.com/kylef/PathKit.git 
 
Resolving https://github.com/kylef/PathKit.git at 0.8.0 
 
Compile Swift Module 'Spectre' (8 sources) 
 
Compile Swift Module 'PathKit' (1 sources) 
 
Compile Swift Module 'Stencil' (19 sources) 
 
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Context.swift:46:25: warning: expression implicitly coerced from 'Any?' to Any 
 
    return dictionaries.popLast() 
 
         ^~~~~~~ 
 
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Context.swift:46:25: note: provide a default value to avoid this warning 
 
    return dictionaries.popLast() 
 
         ^~~~~~~ 
 
           ?? <#default value#> 
 
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Context.swift:46:25: note: force-unwrap the value to avoid this warning 
 
    return dictionaries.popLast() 
 
         ^~~~~~~ 
 
           ! 
 
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Context.swift:46:25: note: explicitly cast to Any with 'as Any' to silence this warning 
 
    return dictionaries.popLast() 
 
         ^~~~~~~ 
 
           as Any 
 
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Loader.swift:55:14: warning: no calls to throwing functions occur within 'try' expression 
 
     return try environment.templateClass.init(templateString: content, environment: environment, name: name) 
 
      ^
 
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Loader.swift:68:18: warning: no calls to throwing functions occur within 'try' expression 
 
      return try environment.templateClass.init(templateString: content, environment: environment, name: templateName) 
 
       ^
 
Compile Swift Module 'XCUIReportGenerator' (13 sources) 
 
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8: error: no such module 'libxml2' 
 
import libxml2 
 
    ^
 
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8: error: no such module 'libxml2' 
 
import libxml2 
 
    ^
 
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8: error: no such module 'libxml2' 
 
import libxml2 
 
    ^
 
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8: error: no such module 'libxml2' 
 
import libxml2 
 
    ^
 
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8: error: no such module 'libxml2' 
 
import libxml2 
 
    ^
 
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8: error: no such module 'libxml2' 
 
import libxml2 
 
    ^
 
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8: error: no such module 'libxml2' 
 
import libxml2 
 
    ^
 
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8: error: no such module 'libxml2' 
 
import libxml2 
 
    ^
 
<unknown>:0: error: build had 1 command failures 
 
error: exit(1): /Applications/Xcode8.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/zaid/XCUI-ReportGen/.build/debug.yaml

Link to the output from my debug.yaml run

+1

在這個問題中(或標題中)我沒有看到單個問號標點符號。所以......問題是什麼? –

+0

我的問題是,當我試圖通過包管理器安裝模板時,我做錯了什麼? –

回答

0

它看起來像你正在嘗試使用的libxml。這是一個C庫,沒有必要的包裝庫,它不會在Swift中生成。另見this question

相關問題