<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div>Probably this is a link path issue. Can you open a ticket including your module map and an example source?</div><div><br class=""></div><div><a href="https://bugs.swift.org" class="">https://bugs.swift.org</a></div><div><br class=""></div><div>Thanks,</div><div><br class=""></div><div>Max</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="" style="font-family: Calibri; font-size: 16px;">From:</div><div class=""><span class="Apple-converted-space">&nbsp;</span><a href="mailto:gagemorgan@outlook.com" class="" style="font-family: Calibri; font-size: 16px;">gagemorgan@outlook.com</a><br class=""><font face="Calibri" size="3" class="">To:</font><span class="Apple-converted-space" style="font-family: Calibri; font-size: 16px;">&nbsp;</span><a href="mailto:mawadah@apple.com" class="" style="font-family: Calibri; font-size: 16px;">mawadah@apple.com</a><br class=""><font face="Calibri" size="3" class="">Subject: RE: [swift-users] Binding Regular C Functions (Gtk, Cairo, etc.)</font><br class=""><font face="Calibri" size="3" class="">Date: Tue, 8 Dec 2015 18:03:42 -0500</font><br class=""><br class=""><div dir="ltr" class="" style="font-family: Calibri; font-size: 16px;">So...including cairo in an app returns this:<div class=""><br class=""></div><div class=""><div class="">Linking Executable: &nbsp;.build/debug/example</div><div class="">/usr/bin/ld: cannot find -l/usr/lib/x86_64-linux-gnu/libcairo.so</div><div class="">clang: error: linker command failed with exit code 1 (use -v to see invocation)</div><div class="">&lt;unknown&gt;:0: error: link command failed with exit code 1 (use -v to see invocation)</div><div class="">&lt;unknown&gt;:0: error: build had 1 command failures</div><div class="">swift-build: exit(1): ["/home/mgage/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/bin/swift-build-tool", "-f", "/home/mgage/Sources/example/.build/debug/example.o/llbuild.yaml"]</div><div class=""><br class=""></div><div class="">What went amiss?</div><br class=""><div class=""><hr id="ecxstopSpelling" class="">From:<span class="Apple-converted-space">&nbsp;</span><a href="mailto:mawadah@apple.com" class="">mawadah@apple.com</a><br class="">Subject: Re: [swift-users] Binding Regular C Functions (Gtk, Cairo, etc.)<br class="">Date: Mon, 7 Dec 2015 19:27:56 -0800<br class="">To:<span class="Apple-converted-space">&nbsp;</span><a href="mailto:gagemorgan@outlook.com" class="">gagemorgan@outlook.com</a><br class=""><br class="">Once you have followed the instructions to create a system package, your own package declares a dependency on that package. This is also covered in those steps.&nbsp;<div class=""><br class=""></div><div class="">To use the C APIs in your code, simply import the name of the module (as defined by the modulemap entry) in your swift file. It should just work.&nbsp;</div><div class=""><br class=""></div><div class="">For instance, in the example from the sysmodules doc link I sent, you just&nbsp;</div><div class=""><br class=""></div><div class=""><pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; line-height: 1.45; padding: 16px; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal; color: rgb(51, 51, 51);" class=""><span class="ecxpl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">import</span> <span class="ecxpl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">CJPEG</span></pre><div class=""><br class=""></div></div><div class=""><br class=""></div><div class="">The C functions will have the same name in Swift as their C counterparts. The types might adjust to UnsafePointer etc.. For a list of those Swift bindings, run the REPL and import your module, then perform “:type lookup Module” to get a printout of available APIs.</div><div class=""><br class=""></div><div class="">- mish<br class=""><div class=""><br class=""><div class=""><blockquote class=""><div class="">On Dec 7, 2015, at 6:40 PM, Gage Morgan &lt;<a href="mailto:gagemorgan@outlook.com" class="">gagemorgan@outlook.com</a>&gt; wrote:</div><br class="ecxApple-interchange-newline"><div class=""><div class=""><div class="">I read that. What I want to know is how to bind the functions themselves after creating a system package. How to use the c functions that got imported, if you will.&nbsp;<br class=""><br class=""><div class="ecxacompli_signature">Sent from<span class="Apple-converted-space">&nbsp;</span><a href="http://aka.ms/Ox5hz3" target="_blank" class="">Outlook</a></div><br class=""></div><br class=""><br class=""><br class=""><div class="ecxgmail_quote">On Mon, Dec 7, 2015 at 6:39 PM -0800, "Mish Awadah"<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:mawadah@apple.com" target="_blank" class="">mawadah@apple.com</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><br class=""></div><div style="word-wrap: break-word;" class="">Please see the reference at&nbsp;<a href="https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md" target="_blank" class="">https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md</a><div class=""><br class=""></div><div class="">- mish</div><div class=""><br class=""><div class=""><blockquote class=""><div class="">On Dec 7, 2015, at 6:33 PM, Gage Morgan via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="ecxx_Apple-interchange-newline"><div class=""><div class="">For any project: How is a C to Swift function binding created? I'd like to know how to import C functions to Swift. Once I can do this successfully, I'll be all set.&nbsp;<br class=""><br class=""><div class="ecxx_acompli_signature">Sent from<span class="Apple-converted-space">&nbsp;</span><a href="http://aka.ms/Ox5hz3" target="_blank" class="">Outlook</a></div><br class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=xTF6JWnt2pl7kNka7081D3VajDoXFZTI5JEuSuQLncpUdQ-2Fw9ccP6Ms6ZCRWxxCNMvcjqMyXkU0xtEyNnPmbbGvau5P1qozRM4wtwri-2FpSE-2FEXZuvlDszaEHYzSaksD893r-2F0sy5YAMh13FZ-2FWZGIN1dOJKBHRj4RWzKT7VB4TiHfQz-2Bi3FZ5dWnGHOoMc8lIsDrxDgXNI1Bp2xBSGaIJ9Xt41Lsoi-2F7pvCk4eQUYxk-3D" alt="" width="1" height="1" border="0" style="height: 1px !important; width: 1px !important; border-width: 0px !important; padding: 0px !important;" class=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________<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" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-users</a><br class=""></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></div></div></div></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=cbMbdH1LnH6O78Q-2BHw3jtU8ikibH470Fh9meAJKpwSpG0xvG09XBwyh1ip3uHvehcLlAkID-2FqU1H9B5dR6zglJbXnqrSINNy8-2FpsixdkcCvV9Eybp75i8Dxszxa3ZVsllVkRoBI4NzELeV0JbJbv5UjYD7aWofXQ9tIoiLuUqgr32Nlh1Ysy9W9lbr-2B1UMb0wMuT93-2Fp9gBUy3zTADn483kSaYiu9sCMheYeJ5ubKDY-3D" alt="" width="1" height="1" border="0" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________</span><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-users mailing list</span><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-users@swift.org" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-users@swift.org</a><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-users" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-users</a></div></blockquote></div><br class=""></body></html>