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. Statically Compile Ressource File
Forum Updated to NodeBB v4.3 + New Features

Statically Compile Ressource File

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.1k Views 1 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.
  • 1 Offline
    1 Offline
    10Htts
    wrote on last edited by
    #1

    First, English isn't my first language....
    I learned all i know about programmation on youtube so, if you have any ! any ! constructive comment, please write it, i will be very happy!
    My problem is that when i compile it dynamically, it's flawless, works like it's supposed to but, when i try to compile it in static mode, i get an error ([debug/qrc_Dossier.cpp] Error 2) that i can't find anywhere by googling it.

    i read a lot about (Error 1, file not found) an how to compile with only an image icon but, none of them worked for me.

    Link for all my program (Something near at least...): "Link":http://rapidshare.com/files/4200075700/Multi-Download.rar

    In .pro
    @CONFIG += static

    RESOURCES +=
    Dossier.qrc@

    In main.cpp
    @int main(int argc, char *argv[])
    {
    Q_INIT_RESOURCE();
    QApplication a(argc, argv);
    @

    In Dossier.qrc (i've read about .rc... don't know the difference..)
    @<RCC>
    <qresource prefix="/icons">
    <file>Tatice-Browsers-Download.ico</file>
    <file>Benjigarner-Softdimension-7zip.ico</file>
    <file>Iconmoon-Web-Application-Load.ico</file>
    <file>Iconmoon-Web-Application-Save.ico</file>
    <file>Saki-Snowish-Extras-internet-download.ico</file>
    </qresource>
    <qresource prefix="/7Zip">
    <file>7z.dll</file>
    <file>7z.exe</file>
    <file>7z.sfx</file>
    <file>7zCon.sfx</file>
    <file>7zFM.exe</file>
    <file>7zG.exe</file>
    <file>7-zip.chm</file>
    <file>7-zip.dll</file>
    <file>descript.ion</file>
    <file>History.txt</file>
    <file>License.txt</file>
    <file>readme.txt</file>
    </qresource>
    </RCC>@

    Thanks ALOT! for your help!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DerManu
      wrote on last edited by
      #2

      Did you compile your Qt as static library? Out of the box (from the downloadable, pre-compiled packages), it's always dynamic linking, as far as I know.

      1 Reply Last reply
      0
      • 1 Offline
        1 Offline
        10Htts
        wrote on last edited by
        #3

        Yes, i've done this, there was an error with a file in debug mode but, i've compiled it sucessfully in realease mode by deleting the QRC File.
        Thanks

        1 Reply Last reply
        0
        • 1 Offline
          1 Offline
          10Htts
          wrote on last edited by
          #4

          Up!

          1 Reply Last reply
          0
          • P Offline
            P Offline
            panosk
            wrote on last edited by
            #5

            You have to initialize the resource with the base name of your qrc file
            @
            Q_INIT_RESOURCE(Dossier)
            @

            1 Reply Last reply
            0
            • 1 Offline
              1 Offline
              10Htts
              wrote on last edited by
              #6

              It doesn't solve it, i've got the exact same error...
              PS: i'm running Win 7 x64
              I tried including the static plugin (qico) :
              .pro:
              @QTPLUGIN += qico
              LIBS += "G:\Qt\4.8.3\plugins\imageformats"@
              main.cpp:
              @#include <QtPlugin>
              Q_IMPORT_PLUGIN(qico)@

              Yet, same exact error...
              i've even deleted from the container (.qrc) every file that were not .ico and, same error...
              :-1: error: [release/qrc_Dossier.cpp] Error 2
              Thanks for your reply!

              1 Reply Last reply
              0

              • Login

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