Undefined Symbol {Package}_{Module}_SWIFTPM_MODULE_BUNDLE()

I have an Obj-C++ module in a Swift Package and I am attempting to use SWIFTPM_MODULE_BUNDLE to access resources in the package. When I try to use the package in my main project I get the following error:

Undefined symbols for architecture arm64:
  "{Package}_{Module}_SWIFTPM_MODULE_BUNDLE()", referenced from:
ld: symbol(s) not found for architecture arm64

Where {Package} and {Module} are substitutes for my real package and module names.
I see the resource_bundle_accessor.h and .m in my project DerivedSources. What am I missing?

I solved this by wrapping the SWIFTPM_MODULE_BUNDLE in a plain Objective-C class (BundleHelper.h/m) and calling it from a class method on BundleHelper in my Obj-C++ class.

Terms of Service

Privacy Policy

Cookie Policy