Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QT Resource not loading in static build of QT 1.15.1
Hello i am trying to build my app on a static version of qt but there seems to be a issue the resources are not loaded, nor are they loaded in a dynamic build outside of creator debugging i have no idea why. how can i fix this?
Do you have something like
in the .pro file ?
i have this in my pro file
Ok seems fine.
If you go to the build folder and look
Do you then have
No, but i do have qrc_images.o and qrc_images.cpp.
Ok super. it means it does compile it.
so how do you see its not working ?
The images dont show up not even when running from Creator ?
On static compile they dont show up in creator on dynamic they do, but not when opening from outside creator.
On dynamic, outside of creator did you make a deployment folder to run it from?
Some file types like jpg require a plugin next to the .exe to work outside.
You can use the deployment folder to create this folder
For your static version, its hard to guess on but maybe you didn't include the
image plugins in the build.
Well my app uses one png and svgs for the rest i tried putting Qt5Svg.dll in there but no effect
Try the tool as each .dll might need other dlls.
Well there is something i am missing in my code because msvc wont do the trick eiter i am not sure what i am doing wrong. Is there somekind of know working example of qtresources
I have a test project.
it should look like this
raketmus last edited by raketmus
I think this is a issue with svgs as all other images work i will rebuild qt static with -qt-svg added.
editited due to post wait.
It also works fine with a subfolder in the project folder.
But you must adjust the path you use then.
well it is the svg that is the problem but i dont know how to make qt build qtsvg as when i try to build https://github.com/qt/qtsvg
i get qsvgrender.h not found if i then manualy change the include location to fix that, i know how no idea how i am suppose to include this module i cant seem to find any examples or guides online nor in the project folder
I have solved this by running the following command on qt 1.15.1 source
C:\Qt\qt-everywhere-src-5.15.1\configure.bat -release -static -opensource -confirm-license -static-runtime -qt-zlib -qt-libjpeg -qt-tiff -qt-webp -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -gui -widgets -no-pch -opengl desktop -platform win32-g++ -prefix "C:\Qt\QT-Static" -skip webengine -nomake tools -nomake tests -nomake examples -openssl-linked -I "C:\OpenSSL-Win64\include" -L "C:\OpenSSL-Win64\lib" OPENSSL_LIBS="-lWs2_32 -lGdi32 -lAdvapi32 -lCrypt32 -lUser32" OPENSSL_LIBS_DEBUG="-lssl -lcrypto" OPENSSL_LIBS_RELEASE="-lssl -lcrypto" mingw32-make -j8 mingw32-make install pause
in a .ps1 script.
this builds qt with openssl linked i used the prebuildt libaries from here https://bintray.com/vszakats/generic/openssl/1.1.1g
put in a folder with the libs renamed to crypto.a and ssl.a .