I suppose I have to link my C++ code with the Swift runtime to resolve the "_swift_release" and "_swift_retain" symbols.
I need to add a flag when building the Swift lib for the Swift lib include the runtime ? Or a way to link the Swift runtime from C++ ?
I am testing with the Feb 01 5.8 snapshot on macOS 13.2, MacBook Air M1.
admin@mbam1 CxxToSwift % xcrun --toolchain "Swift 5.8 Development Snapshot" clang++ main.cpp -lMySwiftLib Undefined symbols for architecture arm64: "_swift_release", referenced from: swift::_impl::RefCountedClass::~RefCountedClass() in main-bdab04.o "_swift_retain", referenced from: swift::_impl::RefCountedClass::RefCountedClass(swift::_impl::RefCountedClass const&) in main-bdab04.o ld: symbol(s) not found for architecture arm64 clang-13: error: linker command failed with exit code 1 (use -v to see invocation)