Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
None
-
6.5.0
-
None
-
I have tested on windows, linux, and macos github action runers.
You can see simple reproducible enviroment on https://github.com/EddyTheCo/Bugreport
Description
Shared libraries that use signal and slots fail to link on windows.
You can see simple reproducible example of the issue here, and just do
qt-cmake -G Ninja -DCMAKE_BUILD_TYPE="release" -DCMAKE_INSTALL_PREFIX="../install" -DBUILD_SHARED_LIBS=ON ../SourceCode
When linking 2 libraries that use signal and slots and specifically expand the
Q_OBJECT macro with the declaration of
public: static struct QMetaObject const Xclass::staticMetaObject
The linker return
error LNK2019: unresolved external symbol "public: static struct QMetaObject const Xclass::staticMetaObject"
This only happen on windows, I have compiled without problems the same library for macos and linux.
I am wondering if the problem is that moc(or the Q_OBJECT macro) do not export(import) correctly the missing symbol like
Q_DECL_EXPORT(Q_DECL_IMPORT) static struct QMetaObject const Xclass::staticMetaObject