<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Ankit,<div class=""><br class=""></div><div class="">Thank you very much! It works now :-)</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Toni</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">Am 03.10.2017 um 21:50 schrieb Ankit Aggarwal &lt;<a href="mailto:ankit_aggarwal@apple.com" class="">ankit_aggarwal@apple.com</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Toni,<div class=""><br class=""></div><div class="">You're not supposed to build the system module package (because there is nothing to build). Tag and add this package as a dependency and then try to import the `TestPkg` module that you defined in the modulemap. The error here is bogus and is tracked by&nbsp;<a href="https://bugs.swift.org/browse/SR-5383" class="">https://bugs.swift.org/browse/SR-5383</a></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Oct 3, 2017 at 12:32 AM, Toni Suter via swift-users <span dir="ltr" class="">&lt;<a href="mailto:swift-users@swift.org" target="_blank" class="">swift-users@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hi,<div class=""><br class=""></div><div class="">I am trying to create a Swift Package that wraps the ImageMagick C API. So I installed ImageMagick using MacPorts and</div><div class="">I was then able to build the sample program with the following commands:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">export PKG_CONFIG_PATH=/opt/local/<wbr class="">lib/pkgconfig</font></div><div class=""><font face="Menlo" class="">cc main.c `pkg-config --cflags --libs MagickWand`</font></div><div class=""><br class=""></div><div class="">Then I created a package with the command "swift package init --type=system-module" and I modified Package.swift to look</div><div class="">like this:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">// swift-tools-version:4.0</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">import PackageDescription</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">let package = Package(</font></div><div class=""><font face="Menlo" class=""><span class="m_3924061561907978677Apple-tab-span" style="white-space:pre-wrap">        </span>name: "TestPkg",</font></div><div class=""><font face="Menlo" class=""><span class="m_3924061561907978677Apple-tab-span" style="white-space:pre-wrap">        </span>pkgConfig: "MagickWand"</font></div><div class=""><font face="Menlo" class="">)</font></div><div class=""><br class=""></div><div class="">and I modified module.modulemap to the following:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Menlo" class="">module TestPkg [system] {</font></div><div class=""><font face="Menlo" class="">&nbsp; header "/opt/local/include/<wbr class="">ImageMagick-6/wand/MagickWand.<wbr class="">h"</font></div><div class=""><font face="Menlo" class="">&nbsp; link "MagickWand-6.Q16"</font></div><div class=""><font face="Menlo" class="">&nbsp; link "MagickCore-6.Q16"</font></div><div class=""><font face="Menlo" class="">&nbsp; export *</font></div><div class=""><font face="Menlo" class="">}</font></div></div><div class=""><br class=""></div><div class="">Now when I run "swift build", I get the following error message:</div><div class=""><br class=""></div><div class="">&lt;unknown&gt;:0:&nbsp;error:&nbsp;unexpected 'commands' value (expected map)<br class="">&lt;unknown&gt;:0:&nbsp;error:&nbsp;unable to load build file<br class="">error:&nbsp;terminated(1): /Library/Developer/Toolchains/<wbr class="">swift-4.0-DEVELOPMENT-<wbr class="">SNAPSHOT-2017-08-27-a.<wbr class="">xctoolchain/usr/bin/swift-<wbr class="">build-tool -f /Users/tonisuter/Desktop/<wbr class="">TestPkg/.build/debug.yaml main</div><div class=""><br class=""></div><div class="">Does anybody know how I can fix this error?</div><div class=""><br class=""></div><div class="">Thanks and best regards</div><span class="HOEnZb"><font color="#888888" class=""><div class="">Toni</div></font></span></div><br class="">______________________________<wbr class="">_________________<br class="">
swift-users mailing list<br class="">
<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-users</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>