Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT Resource not loading in static build of QT 1.15.1
Forum Updated to NodeBB v4.3 + New Features

QT Resource not loading in static build of QT 1.15.1

Scheduled Pinned Locked Moved Solved General and Desktop
16 Posts 2 Posters 933 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    raketmus
    wrote on last edited by
    #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?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Do you have something like
      RESOURCES +=
      icons.qrc

      in the .pro file ?

      1 Reply Last reply
      0
      • R Offline
        R Offline
        raketmus
        wrote on last edited by
        #3

        RESOURCES +=
        images.qrc
        i have this in my pro file

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          Hi
          Ok seems fine.
          If you go to the build folder and look
          Do you then have
          qrc_images.obj ?

          1 Reply Last reply
          0
          • R Offline
            R Offline
            raketmus
            wrote on last edited by
            #5

            No, but i do have qrc_images.o and qrc_images.cpp.

            mrjjM 1 Reply Last reply
            0
            • R raketmus

              No, but i do have qrc_images.o and qrc_images.cpp.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @raketmus
              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 ?

              1 Reply Last reply
              0
              • R Offline
                R Offline
                raketmus
                wrote on last edited by
                #7

                On static compile they dont show up in creator on dynamic they do, but not when opening from outside creator.

                mrjjM 1 Reply Last reply
                0
                • R raketmus

                  On static compile they dont show up in creator on dynamic they do, but not when opening from outside creator.

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  hi
                  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
                  https://doc.qt.io/qt-5/windows-deployment.html

                  For your static version, its hard to guess on but maybe you didn't include the
                  image plugins in the build.

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    raketmus
                    wrote on last edited by
                    #9

                    Well my app uses one png and svgs for the rest i tried putting Qt5Svg.dll in there but no effect

                    mrjjM 1 Reply Last reply
                    0
                    • R raketmus

                      Well my app uses one png and svgs for the rest i tried putting Qt5Svg.dll in there but no effect

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @raketmus
                      Try the tool as each .dll might need other dlls.

                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        raketmus
                        wrote on last edited by
                        #11

                        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

                        mrjjM 1 Reply Last reply
                        0
                        • R raketmus

                          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

                          mrjjM Offline
                          mrjjM Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @raketmus
                          Hi
                          I have a test project.
                          https://www.dropbox.com/s/msmtzl5zxu6blp6/restest.zip?dl=0

                          it should look like this

                          alt text

                          1 Reply Last reply
                          0
                          • R Offline
                            R Offline
                            raketmus
                            wrote on last edited by raketmus
                            #13

                            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.

                            mrjjM 1 Reply Last reply
                            1
                            • R 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.

                              mrjjM Offline
                              mrjjM Offline
                              mrjj
                              Lifetime Qt Champion
                              wrote on last edited by mrjj
                              #14

                              @raketmus
                              It also works fine with a subfolder in the project folder.
                              But you must adjust the path you use then.
                              ":/images/filename.ext"

                              updated project
                              https://www.dropbox.com/s/bz6h6cihg4zvlw4/restest2.zip?dl=0

                              1 Reply Last reply
                              1
                              • R Offline
                                R Offline
                                raketmus
                                wrote on last edited by
                                #15

                                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

                                1 Reply Last reply
                                0
                                • R Offline
                                  R Offline
                                  raketmus
                                  wrote on last edited by
                                  #16

                                  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 .

                                  1 Reply Last reply
                                  2

                                  • Login

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Users
                                  • Groups
                                  • Search
                                  • Get Qt Extensions
                                  • Unsolved