<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 14.10.2017 um 21:55 schrieb Edward Connell via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Has anyone used the SwiftProtobuf module on Linux?<div class=""><a href="https://github.com/apple/swift-protobuf" class="">https://github.com/apple/swift-protobuf</a><br class=""></div><div class=""><br class=""></div><div class="">I am able to successfully generate swift classes from my proto file.</div><div class="">However when building, the code compiles but I get a ton of undefined link references.</div><div class=""><br class=""></div><div class="">I included -Xswiftc -I/home/ed/swift-protobuf/.build/release so the module is found, but still….</div></div></div></blockquote><div><br class=""></div><div>This should be "-Xlinker” rather than “-Xswiftc”, and also “-l” is for specifying system library names (e.g. "-latomic”). I’m pretty new to this but I think the correct flag is “-L”.</div><div>So in the past I have used “-Xlinker -L/path/to/libs”, but I’ve recently read you can actually leave off “-Xlinker” and just have the “-L” bit.</div><div><br class=""></div><div>Hope that helps.</div><div><br class=""></div><div>- Geordie</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class=""><div class="">------------------------</div><div class="">/home/ed/Documents/prototest/Sources/DataModel.pb.swift:31: error: undefined reference to '_T013SwiftProtobuf14UnknownStorageVACycfC'</div><div class="">/home/ed/Documents/prototest/Sources/DataModel.pb.swift:31: error: undefined reference to '_T013SwiftProtobuf14UnknownStorageVACycfC'</div><div class="">/home/ed/Documents/prototest/Sources/DataModel.pb.swift:64: error: undefined reference to '_T013SwiftProtobuf14UnknownStorageV8traverseyxz7visitor_tKAA7VisitorRzlF'</div><div class="">/home/ed/Documents/prototest/Sources/DataModel.pb.swift:0: error: undefined reference to '_T013SwiftProtobuf7MessagePAAE13isInitializedSbfg'</div></div><div class=""><br class=""></div><div class="">etc...</div><div class=""><br class=""></div><div class="">Does anyone have a simple working example on Ubuntu?</div><div class=""><br class=""></div><div class="">Ubuntu 16.04</div><div class="">Swift 4.0 release</div><div class=""><br class=""></div><div class="">Thanks, Ed</div></div>
_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></body></html>