[swift-users] Linux - How to use C libs

Mish Awadah mawadah at apple.com
Mon Dec 7 13:06:50 CST 2015


Please file a bug describing the situation and your environment. We’d be happy to make this easier for you in the future.

- mish

> On Dec 5, 2015, at 11:51 AM, Damien BRUN via swift-users <swift-users at swift.org> wrote:
> 
> Works with simple libs which can be referenced by a simple path. With Gdk/Gtk who share a single include dir, module compilation can't find its way. No matter what I try, I end up with :
> 
> <module-includes>:1:10: note: in file included from <module-includes>:1: #include “gtk/gtk.h”
> 
> ^
> /usr/include/gtk-3.0/gtk/gtk.h:30:10: error: ‘gdk/gdk.h’ file not found #include <gdk/gdk.h>
> 
> Seems like one would have to rewrite gtk/gdk headers to please clang…
> 
> 2015-12-05 19:40 GMT+01:00 Damien BRUN <dev at lanza.fr>:
> 
> Thanks Harlan for the link, this is what I'm trying to do. =)
> With interdependent libs, this becomes a mess anyway... (tried gdk/gtk...)
> & thanks René for the video. Very interesting for what will come next.
> 2015-12-05 18:07 GMT+01:00 Harlan Haskins <harlan at harlanhaskins.com>:
> C libraries require you to create modules for them. There's a great guide with examples for importing libjpeg into Swift on GitHub:
> https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md
> On Dec 5, 2015, at 8:58 AM, Damien BRUN <dev at lanza.fr> wrote:
> Hello Again,
> Now that I have a functional Swift installation, I'd like to know if/how I can use C libs ?
> How do I import headers & link to the right libs ?
> Thanks
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
> _____________________________________________ swift-users mailing list swift-users at swift.org https://lists.swift.org/mailman/listinfo/swift-users <https://lists.swift.org/mailman/listinfo/swift-users>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151207/2350c88d/attachment.html>


More information about the swift-users mailing list