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

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


You don’t need the -Xlinker.  -L/path/to/libraries is fine all by itself.


> On Oct 11, 2017, at 12:11 PM, Jonathan Prescott via swift-users <swift-users at swift.org> wrote:
> 
> 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 <mailto: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 <mailto: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

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


More information about the swift-users mailing list