[swift-users] Binding Regular C Functions (Gtk, Cairo, etc.)

Gage Morgan gagemorgan at outlook.com
Wed Dec 9 15:44:43 CST 2015


So the first time I tried with just cairo, then libcairo. Then I thought it might work with the direct path. So after some frustration with it saying "Module not found," I tried running swift build on both directories and it gave me that output: It recognized the .so file but then went on to say it could not find it, and abruptly quit. So then I wondered: How do I get cairo running? At least I got it installed and working.

Sent from Outlook Mobile




On Wed, Dec 9, 2015 at 1:27 PM -0800, "Gage Morgan via swift-users" <swift-users at swift.org> wrote:





So if the name of the library is libcairo amd to imstall I had to type "sudo apt-get install libcairo2-dev, what would I put for "link:?"

Sent from Outlook Mobile




On Wed, Dec 9, 2015 at 1:21 PM -0800, "Max Howell" <max.howell at apple.com> wrote:





No, if the directories are separate they are separate to `swift build`.

The problem is it already cloned CCairo into your example, and a dependency manager should not change cloned dependencies as part of the build process.

I agree it is confusing, but I will be adding warnings and information to help here. It’s early days.

> On Dec 9, 2015, at 1:13 PM, Gage Morgan <gagemorgan at outlook.com> wrote:
>
> So would things break if I ran swift build in the CCairo directory and then example? This so confusing...
>
> Sent from Outlook Mobile <https://aka.ms/sdimjr>
>
>
>
> On Wed, Dec 9, 2015 at 11:19 AM -0800, "Max Howell" <max.howell at apple.com <mailto:max.howell at apple.com>> wrote:
>
> > Gage,
> >
> > For what it's worth, after running `git init` and `git tag -f 1.0.0`
> > in `CCairo` to get something importable, I run into this error:
> >
> > :;  swift build
> > Cloning Packages/CCairo
> > <unknown>:0: error: no such file or directory:
> > '/Users/solidsnack/Downloads/Sources/example/Packages/CCairo/Package.swift’
>
>     rm -rf /Users/solidsnack/Downloads/Sources/example/Packages
>
> The PM does not update the git repo, by default this is the right behavior since you should not change your dependency sources every build. However I agree this is confusing in these situations. We plan some sort of “dev mode”.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151209/c1fd48e9/attachment.html>
-------------- next part --------------
_______________________________________________
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