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

Damien BRUN dev at lanza.fr
Sat Dec 5 13:51:09 CST 2015


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
>
>


More information about the swift-users mailing list