[swift-users] Package Manager: Link to a static library.

Jonathan Prescott jprescott12 at icloud.com
Wed Oct 11 11:11:09 CDT 2017


The library files have to live somewhere.  You need to tell the linker where to look
So,

swift build -Xlinker -L/path/to/the/libraries -L/path/to/more/libraries

should do the trick.  It’s no different than C or C++.

> On Oct 11, 2017, at 7:23 AM, Evtim Papushev via swift-users <swift-users at swift.org> wrote:
> 
> Thanks, but that would not work. Those static library files are not in /usr/lib nor /usr/local/lib. They are part of the package I’m trying to link against.
> 
> So, swift build checkouts the repo. Then it should link them from it.
> 
> Best,
> Evtim
> 
>> On Oct 11, 2017, at 13:49, Fred Appelman <fred at appelman.net <mailto:fred at appelman.net>> wrote:
>> 
>> swift build -Xlinker "-L/usr/local/lib"
> 
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171011/202eff31/attachment.html>


More information about the swift-users mailing list