<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,<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/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="Apple-tab-span" style="white-space:pre">        </span>name: "TestPkg",</font></div><div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space:pre">        </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=""> header "/opt/local/include/ImageMagick-6/wand/MagickWand.h"</font></div><div class=""><font face="Menlo" class=""> link "MagickWand-6.Q16"</font></div><div class=""><font face="Menlo" class=""> link "MagickCore-6.Q16"</font></div><div class=""><font face="Menlo" class=""> 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=""><unknown>:0: error: unexpected 'commands' value (expected map)<br class=""><unknown>:0: error: unable to load build file<br class="">error: terminated(1): /Library/Developer/Toolchains/swift-4.0-DEVELOPMENT-SNAPSHOT-2017-08-27-a.xctoolchain/usr/bin/swift-build-tool -f /Users/tonisuter/Desktop/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><div class="">Toni</div></body></html>