Undefined symbols when using private struct properties in Swift w/ ObjC


I noticed the following:

When a Swift class TestA has a private (!) property of type struct that itself is defined in a separate Swift framework dependency, and there is an Objective-C class TestB using class TestA then I get something like

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$__TtC23My_Demo7TestA", referenced from:
      objc-class-ref in TestB.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This error does not happen when the struct is defined in the app itself and not the framework, moreover, when we disable "Build libraries for distribution" when compiling the framework, the error disappears as well.

Can anyone shed some light on this?


Terms of Service

Privacy Policy

Cookie Policy