ethand91 / mediasoup-ios-client

Mediasoup 3 iOS Client
ISC License
130 stars 64 forks source link

Undefined symbols for architecture arm64 while building for iOS #90

Closed ghost closed 3 years ago

ghost commented 3 years ago

Rebuilt libwebrtc.a, libmediasoupclient.a, libsdptransform.a according to guide, but in XCode project getting this error while trying to build. Checked paths, frameworks & libraries, but everything seems to be in place..

Undefined symbols for architecture arm64:
  "webrtc::CreatePeerConnectionFactory(rtc::Thread*, rtc::Thread*, rtc::Thread*, rtc::scoped_refptr<webrtc::AudioDeviceModule>, rtc::scoped_refptr<webrtc::AudioEncoderFactory>, rtc::scoped_refptr<webrtc::AudioDecoderFactory>, std::__1::unique_ptr<webrtc::VideoEncoderFactory, std::__1::default_delete<webrtc::VideoEncoderFactory> >, std::__1::unique_ptr<webrtc::VideoDecoderFactory, std::__1::default_delete<webrtc::VideoDecoderFactory> >, rtc::scoped_refptr<webrtc::AudioMixer>, rtc::scoped_refptr<webrtc::AudioProcessing>)", referenced from:
      mediasoupclient::PeerConnection::PeerConnection(mediasoupclient::PeerConnection::PrivateListener*, mediasoupclient::PeerConnection::Options const*) in libmediasoupclient.a(PeerConnection.cpp.o)
     (maybe you meant: webrtc::CreatePeerConnectionFactory(rtc::Thread*, rtc::Thread*, rtc::Thread*, rtc::scoped_refptr<webrtc::AudioDeviceModule>, rtc::scoped_refptr<webrtc::AudioEncoderFactory>, rtc::scoped_refptr<webrtc::AudioDecoderFactory>, std::__1::unique_ptr<webrtc::VideoEncoderFactory, std::__1::default_delete<webrtc::VideoEncoderFactory> >, std::__1::unique_ptr<webrtc::VideoDecoderFactory, std::__1::default_delete<webrtc::VideoDecoderFactory> >, rtc::scoped_refptr<webrtc::AudioMixer>, rtc::scoped_refptr<webrtc::AudioProcessing>, webrtc::AudioFrameProcessor*))
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

also getting bunch of warnings libsdptransform.a(grammar.cpp.o)) was built for newer iOS version (14.2) than being linked (10.0) on every cpp file (total 17) but i couldnt find where can i set target sdk for libsdptransform

tried

set(IPHONE_SDKVER "14.2")
set(IPHONE_VERSION_MIN "10.0")

inside mediasoup-client-ios/dependencies/CMakeLists.txt but it didnt help with libsdptransform warnings (not sure is that important or not either)

PS: Also rebuilt WebRTC.framework with use_xcode_clang = true in separate directory and put it inside out_ios_libs if that matters

Not sure is this some clang conflict or I should not have mess they deployment targets, kinda new to this but I need slightly custom webrtc build so trying to rebuild mediasoup with that

UPD: I just noticed that it is missing AudioFrameProcessor parameter at the end, so probably because of version mismatches.. Is there a way to fix it myself to latest version? Or if you just confirm that it is webrtc version mismatch i can try to update myself (if thats possible) or downgrade my webrtc sources to m84 (is that latest supported?)

ethand91 commented 3 years ago

What XCode version are you running? Also this will only work with webrtc branch m84, latest is not supported.

Rostyk commented 3 years ago

@nonpensavo Hello there. I'm experiencing exactly the same issues. Checked all the framework/library search paths. Still having undefined symbols: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_MediasoupDevice", referenced from: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Did you try any other steps to fix it? Any feedback would be appreciated. Thanks

ethand91 commented 3 years ago

Probably only occurs with newer versions of XCode?

ethand91 commented 3 years ago

Closing for now...