tristanhimmelman / ObjectMapper

Simple JSON Object mapping written in Swift
MIT License
9.13k stars 1.03k forks source link

Linker Error: Undefined symbol: protocol descriptor for ObjectMapper.BaseMappable #1110

Open topherpalmer opened 3 years ago

topherpalmer commented 3 years ago

I'm getting the linker error below with ObjectMapper 3.5.2:

ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Undefined symbol: protocol descriptor for ObjectMapper.BaseMappable Undefined symbol: protocol descriptor for ObjectMapper.Mappable Undefined symbol: ObjectMapper.<- infix(inout A?, ObjectMapper.Map) -> () Undefined symbol: ObjectMapper.Map.subscript.getter : (Swift.String) -> ObjectMapper.Map Undefined symbol: ObjectMapper.<- infix(inout [A]?, ObjectMapper.Map) -> ()

I'm on Xcode 12 in Swift based application. I also have a ObjC bridging header file for another framework. If I remove said file the linker error doesn't go away. I'm installing using cocoapods and have tried to remove other frameworks that might be interfering with no success. I also can get a clean build with all the frameworks I need installed, the bridging file in place, by removing any classes I have referencing ObjectMapper.

My inclination is to start manipulating the Build Settings but wanted to see if anyone had this same issue. Any help is greatly appreciated. Thanks.

smelloftime commented 3 years ago

I also encountered the same problem. Solve it by the following way: comment out ObjectMapper from pod.file and import it directly into the project. Compilation is successful!