Cannot put Objective-C classes in structs #19541
Labels
Arch:x86_64
Issues specific to x86_64
Feature:extern (C/C++/Obj-C)
interfacing to C, C++, Objective-C code
P2
Severity:major
Jacob Carlborg (@jacob-carlborg) reported this on 2019-02-23T11:32:13Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=19694
CC List
Description
The following code fails to link with DMD 2.085.0-beta.1 extern (Objective-C) class NSObject {} struct Foo { NSObject o; } void main() {} The error is: Undefined symbols for architecture x86_64: "__D4main8NSObject7__ClassZ", referenced from: __D25TypeInfo_xC4main8NSObject6__initZ in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Error: linker exited with status 1 This issue occurs due to no classinfo is outputted for Objective-C classes. This is intentional, but I'm not sure how to fix it. Global, local or TLS variables or instance variables for classes don't require the classinfo, not sure why a struct field requires it.The text was updated successfully, but these errors were encountered: