Undefined symbols: Linker command failed with exit code 1 (use -v to see invocation)

I'm working on making my iOS app compatible with macOS, and I think I've managed to resolve all the errors, except that when I build my project for macOS, I get the following errors:

Undefined symbols:
Linker command failed with exit code 1 (use -v to see invocation)

The project builds without problems on iOS. How can I get more insight into the source of the error?

In case it's relevant: I am using this WebRTC package, which should be compatible with macOS.

Answered by Superabundant in 775298022

The problem appears to be a recent version of the WebRTC package. Details here.

Accepted Answer

The problem appears to be a recent version of the WebRTC package. Details here.

Have you tried enabling Rosetta support in Xcode if using an Apple Silicon device?

Ok, I looked at the WebRTC source code from the GitHub project, and there is no AppKit support, just UIKit. If you target a macOS app with macCatalyst, then any derived or subclassed UIView or UIKit-based view or controller subclassed view like RTCEAGLVideoView and RTCMTLVideoView will use the correct symbols. For macOS support using the swift package is going to call for a separate Xcode project targeting macCatalyst.

For example: UIView class type is UIKit only. To get this on macOS you will have to use a macCatalyst target.

open class RTCEAGLVideoView : UIView, RTCVideoRenderer {

    
    weak open var delegate: RTCVideoViewDelegate?

    
    public init(frame: CGRect, shader: RTCVideoViewShading)

    
    public init(coder aDecoder: NSCoder, shader: RTCVideoViewShading)

    
    /** @abstract Wrapped RTCVideoRotation, or nil.
     */
    open var rotationOverride: NSValue?
}

RTCMTLNSVideoView works natively on macOS for me with M116, but not with later versions of the WebRTC package.

Are you using Mac catalyst? I saw a November response on the google repo referring to iOS support only. If these views are UIView based views then there is no way they will ever work natively on macOS (AppKit) without the help of macCatalyst or Designed for iPad destinations added to the target you’re coding against.

Undefined symbols: Linker command failed with exit code 1 (use -v to see invocation)
 
 
Q