[swift-users] SwiftProtobuf unable to link on Ubuntu

Edward Connell ewconnell at gmail.com
Mon Oct 16 12:03:28 CDT 2017


Hi Alex,
Yes of course using the Swift PM is what I needed to do. What was I
thinking! ;p
It worked, however SwiftProtobuf 1.0.0 does not build cleanly with Swift
4.0 due to the rework of the Strings API. I hope someone will clean that up
soon.

I appreciate your feedback and time, Ed


On Mon, Oct 16, 2017 at 1:42 AM, Alex Blewitt <alblue at apple.com> wrote:

> > On 14 Oct 2017, at 21:41, Geordie J via swift-users <
> swift-users at swift.org> wrote:
> >
> >> swift build -Xswiftc -I/home/ed/swift-protobuf/.build/release -Xlinker
> -L/home/ed/swift-protobuf/.build/release
> >
> > Have you considered using Swift Package Manager to add protobuf as a
> project dependency? Then you wouldn’t have to mess around with command line
> arguments at all. I haven’t used protobuf yet so can’t help with specifics.
>
> I'd strongly recommend using Swift Package Manager to help you here. You
> need to compile and build protobuf and have that linked into your product
> at the same time. Since this is what Swift PM works well for that's
> probably the longer-term supported way forward.
>
> If you're still trying to do this via the command line, I recommend
> finding where you're compiling the .so for the swift-protobuf code, then
> using nm and grep to look through that library to confirm whether or not it
> contains the symbols that your code thinks is missing.
>
> If you have acquired a swift-protobuf binary library from somewhere else,
> it may not have the Swift code you're looking for, or it may be compiled
> with a different version of Swift, both of which can affect the names of
> the symbols being linked. Generally speaking, any _T* symbols are Swift
> symbols, and that's usually a clue that either they are not present in the
> libraries you have specified in the command line, or the library you're
> linking against doesn't have them. Follow the rabbit down the hole and find
> out which if you are against using Swift PM.
>
> Alex
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171016/2e3ac9f6/attachment.html>


More information about the swift-users mailing list