On 13/10/2021 16:08, Frederik Seiffert wrote:
Hi all,
I’ve started looking into building libs-gui for Windows using libobjc2 and the
MSVC ABI, and I’m down to one linker error that I’m unsure how to deal with:
lld-link: error: undefined symbol: __objc_ivar_offset_NSFileWrapper._icon.☺
referenced by NSFileWrapperExtensions.m:42
NSFileWrapperExtensions.m.o:(_i_NSFileWrapper_NSExtensions_setIcon_)
It seems that GUI defines an NSFileWrapper category that accesses an instance
variable defined in Base here, and that results in this linker error. The class
definition in Base is correctly annotated with __declspec(dllexport).
I believe that this is a bug in clang. If the class is dllexported then
the ivar offset variables for public / protected ivars should be
dllexported as well. I think I missed that case when doing the
Objective-C support for Windows - I'll take a look tomorrow.
By the way, I've been using vcpkg for another project (on FreeBSD) -
it's probably the best way of getting the dependencies for any libraries
that GNUstep depends on for the MSVC ABI. It has good CMake integration
but can probably be made to work with GNUstep Make (though if you have a
CMake build system for GNUstep, it should work very nicely).
David