Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.0.3
-
None
-
9466b3629a391ae93c4f06d3627e3dc9e10bba9f
Description
building qt6 with statically linked qt gives undefined symbols. afaict there are three issues:
------
`qRegisterResourceData` is defined inside the qt namespace. this will break code like:
static void initResources()
{
Q_INIT_RESOURCE(qcocoaresources);
}
in qcocoaintegration.mm, which is outside the qt namespace
------
`Q_INIT_RESOURCE` generates an entry point inside the qt namespace, which creates undefined symbols like:
Undefined symbols for architecture x86_64: "qInitResources_scenegraph_NAMESPACE()", referenced from: __GLOBAL__sub_I__ in libQt6Quick.a(qsgdefaultcontext.cpp.o) "qInitResources_qcocoaresources_NAMESPACE()", referenced from: NAMESPACE::QCocoaIntegration::QCocoaIntegration(NAMESPACE::QList<NAMESPACE::QString> const&) in libqcocoa.a(qcocoaintegration.mm.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
—
the namespace is not correctly applied on the compiled resources, either:
Undefined symbols for architecture x86_64: "qInitResources_resources_qmlcache()", referenced from: __GLOBAL__sub_I_qmlcache_loader.cpp in qmlcache_loader.cpp.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)