<div dir="ltr">Tried that, doesn’t help<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 22, 2017 at 4:23 AM, Alex Blewitt <span dir="ltr">&lt;<a href="mailto:alblue@apple.com" target="_blank">alblue@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><br><div><blockquote type="cite"><div>On 21 May 2017, at 20:48, Kelvin Ma via swift-users &lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt; wrote:</div><br class="m_7595845630981481905Apple-interchange-newline"><div><div dir="ltr"><div><div>I’m trying to get Swift working with X11, and I keep getting this linker error when I try to compile:<br><br><font face="monospace,monospace">~/dev/cloudgen$ swift build -v<br>/usr/bin/lsb_release -r<br>/home/kelvin/devtools/swift-3.<wbr>1-dev/usr/bin/swiftc --driver-mode=swift -I /home/kelvin/devtools/swift-3.<wbr>1-dev/usr/lib/swift/pm -L /home/kelvin/devtools/swift-3.<wbr>1-dev/usr/lib/swift/pm -lPackageDescription /home/kelvin/dev/cloudgen/<wbr>Package.swift -fileno 5<br>/home/kelvin/devtools/swift-3.<wbr>1-dev/usr/bin/swift-build-tool -f /home/kelvin/dev/cloudgen/.<wbr>build/debug.yaml -v<br>&#39;/home/kelvin/devtools/swift-<wbr>3.1-dev/usr/bin/swiftc&#39; -Xlinker &#39;-rpath=$ORIGIN&#39; -g -L/home/kelvin/dev/cloudgen/.<wbr>build/debug -o /home/kelvin/dev/cloudgen/.<wbr>build/debug/cloudgen &#39;-lX11&#39; -emit-executable /home/kelvin/dev/cloudgen/.<wbr>build/debug/cloudgen.build/<wbr>main.swift.o<br>/home/kelvin/dev/cloudgen/<wbr>Sources/cloudgen/main.swift:<wbr>22: error: undefined reference to &#39;XOpenDisplay&#39;<br>/home/kelvin/dev/cloudgen/<wbr>Sources/cloudgen/main.swift:<wbr>29: error: undefined reference to &#39;XDefaultScreenOfDisplay&#39;<br>/home/kelvin/dev/cloudgen/<wbr>Sources/cloudgen/main.swift:<wbr>35: error: undefined reference to &#39;XCreateSimpleWindow&#39;<br>/home/kelvin/dev/cloudgen/<wbr>Sources/cloudgen/main.swift:<wbr>38: error: undefined reference to &#39;XSelectInput&#39;<br>/home/kelvin/dev/cloudgen/<wbr>Sources/cloudgen/main.swift:<wbr>41: error: undefined reference to &#39;XMapWindow&#39;<br>/home/kelvin/dev/cloudgen/<wbr>Sources/cloudgen/main.swift:<wbr>47: error: undefined reference to &#39;XNextEvent&#39;<br>/home/kelvin/dev/cloudgen/<wbr>Sources/cloudgen/main.swift:<wbr>52: error: undefined reference to &#39;XFillRectangle&#39;<br>/home/kelvin/dev/cloudgen/<wbr>Sources/cloudgen/main.swift:<wbr>53: error: undefined reference to &#39;XDrawString&#39;<br>clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>&lt;unknown&gt;:0: error: link command failed with exit code 1 (use -v to see invocation)<br>&lt;unknown&gt;:0: error: build had 1 command failures<br><span style="font-family:arial,helvetica,sans-serif"><br></span></font></div><font face="monospace,monospace"><span style="font-family:arial,helvetica,sans-serif">Here is the module.modulemap file I am using:</span><br><br>module X11 [system] {<br>  module Xlib {<br>    header &quot;/usr/include/X11/Xlib.h&quot;<br>  }<br>  module X {<br>    header &quot;/usr/include/X11/X.h&quot;<br>  }<br>  link &quot;X11&quot;<br>}<br></font></div></div></div></blockquote><br></div></div></div><div>If they are umbrella headers that include other header file dependencies, you may need an &#39;export *&#39; in order to make them visible -- otherwise you only get the contents of that header file.</div><div><br></div><div><a href="http://clang.llvm.org/docs/Modules.html#export-declaration" target="_blank">http://clang.llvm.org/docs/<wbr>Modules.html#export-<wbr>declaration</a></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Alex</div><br></font></span></div></blockquote></div><br></div>