Reflection: Xcode 10.2 and Swift 5 problem building
Hi,
on Xcosw 10.2 and in particular with swift 5 there’s a serious problem.
Here is:
Undefined symbols for architecture x86_64: "_swift_getFieldAt", referenced from: closure #1 (Swift.Int) -> (Swift.String, Any.Type) in (extension in Reflection):Reflection.NominalType.fieldNamesAndTypes(for: Any.Type) -> [(Swift.String, Any.Type)]? in NominalType.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I’ve searched on google and found this blog post:
https://www.jishuwen.com/d/2Elq/zh-hk https://github.com/alibaba/HandyJSON/issues/307
Can you help?
Thanks.
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 15 (2 by maintainers)
After all debugging & research with the help of https://github.com/alibaba/HandyJSON/commit/da72f298f05cdc638fd63b92091404c5415c4586
I changed _swift_getFieldAt with swift_getTypeByMangledNameInContext in Nominal.swift file @line 31.
@_silgen_name(“swift_getFieldAt”) —> @_silgen_name(“swift_getTypeByMangledNameInContext”)
I am able to compile & test successfully with this small change.
Try this & share your feedback
@filbertasurion @mapo80 @NSExceptional @tanner0101 I’d highly recommend migrating to wickwirew/Runtime as it’s a maintained version of this lib and operates very similarly.