OSX Undefined symbols
-
Hi,
compiling my desktop application with Qt-5.13.2 on Catalina using native object-c code, I have this linking errors:
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_NSArray", referenced from:
and others similar.Using Qt-5.14 everything is fine, but I must compile it with 5.13.2 or previous.
-
Hi,
@niqt said in OSX Undefined symbols:
NSArray
This class comes from the Foundation framework. You have to link to it.
-
Strange... Can you provide a minimal code sample that triggers this ?
-
You are missing
LIBS += -framework Foundation -framework AppKit
in your .pro file. -
I used a self compiled 5.14.0 and needed to add both frameworks.
In any case, it's always better to not rely on the fact that Qt (or any other library for that matter you are using) might link to a framework you want to use and thus have it in its list of dependencies. That might change at any point in time.
Be explicit, it's always better.