swiftsocket / SwiftSocket

The easy way to use sockets on Apple platforms
BSD 3-Clause "New" or "Revised" License
1.68k stars 401 forks source link

library not found for -lSwiftSocket #193

Closed arik-so closed 4 years ago

arik-so commented 4 years ago

Using Xcode 11 and building against iOS 13, I'm getting the following error:

ld: library not found for -lSwiftSocket clang: error: linker command failed with exit code 1 (use -v to see invocation)

I made sure that I am opening the *.xcworkspace file, and I followed Cocoapod's troubleshooting steps.

Any ideas what might be causing it? I did have to manually change the Pod's Swift version from 3 to 5.

jjetrifork commented 4 years ago

@arik-so

Try updating your Podfile so it contains:

pod 'SwiftSocket', :git => 'https://github.com/swiftsocket/SwiftSocket', commit: '4a3af2cbbaef5b2fddbaff80f6767fecc0ce5fe2'

Then run rm -rf Pods/ && pod install and see if there is still an issue.

arik-so commented 4 years ago

Alas, the issue persists. I cleaned the build folder to be safe, too.

jjetrifork commented 4 years ago

@arik-so Can we see your Podfile? (Feel free to censor sensitive names/targets/data)

arik-so commented 4 years ago

I'm working on an open-source project that relies on some C bindings from a compiled Rust library, so there's nothing secret :)

My Podfile looks thus:

target 'Swift Rust FFI' do
    pod 'SwiftSocket', :git => 'https://github.com/swiftsocket/SwiftSocket', commit: '4a3af2cbbaef5b2fddbaff80f6767fecc0ce5fe2'
end

Before I added a Podfile, though, I did have to add some frameworks and configure a custom Objective-C bridging header as well as a library search path.

jjetrifork commented 4 years ago

Try a Podfile that looks below:

use_frameworks!
inhibit_all_warnings!

target 'Swift Rust FFI' do
    pod 'SwiftSocket', :git => 'https://github.com/swiftsocket/SwiftSocket', commit: '4a3af2cbbaef5b2fddbaff80f6767fecc0ce5fe2'
end

If there is still an issue, I would suggest making a new empty project and try using the Podfile along with the new project to eliminate all sources to the issue expect for your current project.

arik-so commented 4 years ago

Excellent, that worked; thank you so much!