[Qbs] Q_INIT_RESOURCE on Windows
mardy at users.sourceforge.net
Tue Apr 7 21:26:54 CEST 2020
I was about to write this to the QtProject mailing list, but then I
got the doubt that this might be a QBS issue, so I thought of double
checking with you guys first.
I'm building a GUI application which comes with a shared library which
contains some Qt resources that need to be made available to the
However, on windows the build fails, both natively (you can check the
AppVeyor logs here ) and cross-compiled with MXE from Linux. The
main.cpp.obj : error LNK2019: unresolved external symbol "int __cdecl
referenced in function main
C:\projects\mappero\default\mappero.a4d1648d\mappero.exe : fatal error
LNK1120: 1 unresolved externals
The main.cpp files contains Q_INIT_RESOURCE(mappero_ui), and a file
is present in the build directory, and it contains (among a lot of other
stuff) the lines:
int version = 3;
(version, qt_resource_struct, qt_resource_name, qt_resource_data);
I checked with the nm tool (provided by MXE), and the dll library indeed
contains the qInitResources_mappero_ui() symbol; however, the symbol is
not present in the MapperoUi.lib file generated in the same directory.
Shouldn't the symbol in the generated qrc_mappero-ui.cpp file be wrapped
in a Q_DECL_EXPORT() macro?
Could it be that this is a qbs bug, that for some reason it does not
invoke rcc with the right options?
http://www.mardy.it - Geek in un lingua international
More information about the Qbs