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. How to build with static link using qt 4.7.4 for desktop based exe
Forum Updated to NodeBB v4.3 + New Features

How to build with static link using qt 4.7.4 for desktop based exe

Scheduled Pinned Locked Moved General and Desktop
20 Posts 5 Posters 12.6k 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.
  • B Offline
    B Offline
    bu7ch3r
    wrote on last edited by
    #2

    You must build again using -static in configure.exe. I don't use +static in .pro because is useless if you don't have static build of Qt. I think releasing static built apps without license is illegal. Read Qt license agreament or something.

    for(int i = 200; i > 0;)
    try
    {
    //do something
    }
    catch(...)
    {
    i--;//try again
    }

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #3

      I guess you like to compile Qt 4.7.4 for obtaining static libs. The QtSDK has version 1.1.4 at the moment.

      When you have done the compilation of the static libs you use the new lib path for your linking. That should be all you have to do.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        prbiswal
        wrote on last edited by
        #4

        but there is no configure.exe exists in C:\QtSDK\Desktop\Qt\4.7.4\msvc2008..
        how to compile for static ???

        Regards,
        Pradeep

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bu7ch3r
          wrote on last edited by
          #5

          Use info from here http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/.

          for(int i = 200; i > 0;)
          try
          {
          //do something
          }
          catch(...)
          {
          i--;//try again
          }

          1 Reply Last reply
          0
          • L Offline
            L Offline
            le_gweg
            wrote on last edited by
            #6

            Hi

            I used "http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc.":http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc.

            which i find to be the best resource to do so.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #7

              Do not(!) recompile Qt out of the sources bundled with the SDK or any other prebuilt package. This will both wreck your current installation and you won't be able to compile your new version.

              Grab yourself the "vanilla sources":http://qt.nokia.com/downloads/downloads#qt-lib instead.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • P Offline
                P Offline
                prbiswal
                wrote on last edited by
                #8

                i have installed "Qt libraries 4.8.0 for Windows (VS 2008, 273 MB)" since i have VS 2008.
                then could able to configure for static with command
                "configure -static -fast -release -confirm-license -opensource -platform win32-msvc2008"
                then successfully gave "nmake"

                From Qt creator added the qmake.exe from qt4.8 and when i tried to compile qt 4.7.4 installer source code getting the below error :

                installer.lib(init.obj):-1: error: LNK2019: unresolved external symbol "class QObject * __cdecl qt_plugin_instance_qsqlite(void)" (?qt_plugin_instance_qsqlite@@YAPAVQObject@@XZ) referenced in function "public: __thiscall void __cdecl initResources(void)'::6'::StaticqsqlitePluginInstance::StaticqsqlitePluginInstance(void)" (??0StaticqsqlitePluginInstance@?5??initResources@@YAXXZ@QAE@XZ)

                But i am able to compile qt 4.7.1 version of installer source code.

                /Pradeep

                Regards,
                Pradeep

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #9

                  Please see this:

                  [quote author="Volker" date="1326454385"]Do not(!) recompile Qt out of the sources bundled with the SDK or any other prebuilt package. This will both wreck your current installation and you won't be able to compile your new version.

                  Grab yourself the "vanilla sources":http://qt.nokia.com/downloads/downloads#qt-lib instead.[/quote]

                  You must not use the sources delivered with the prebuilt.

                  Vote the answer(s) that helped you to solve your issue(s)

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    prbiswal
                    wrote on last edited by
                    #10

                    I am not getting your points.

                    just i want to compile the latest QT installer source code for our product and want to link it statically.
                    I tried to compile the source using qt 4.7.4 sdk and could not compile it statically as there is no configure.exe..

                    so as suggested by Volker i have installed Qt 4.8.0 pkg for VS 2008 and configured for static. Then used the same qmake.exe to compile the opensource installer code but its failing with some linking errors.

                    FYI : i could able to compile the old version of installer source code using the same qmake.exe
                    could you please suggest me how i can compile them statically.
                    /Pradeep

                    Regards,
                    Pradeep

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      koahnig
                      wrote on last edited by
                      #11

                      Did you download the sources you like to compile separately?
                      The sources as delivered with the SDK and/or the prebuilt you cannot compile. If you like to build a static version you need to download the source from the link supplied by Volker. If you like to build under windows you need to use the zip-file.

                      Vote the answer(s) that helped you to solve your issue(s)

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        goetz
                        wrote on last edited by
                        #12

                        [quote author="pradeep.symbian" date="1326881439"]
                        so as suggested by Volker i have installed Qt 4.8.0 pkg for VS 2008 and configured for static. Then used the same qmake.exe to compile the opensource installer code but its failing with some linking errors.[/quote]

                        NO, I did not suggest this. I told you you to download the vanilla sources and not to recompile Qt out of the sources bundled with the SDK or any other prebuilt package.

                        http://www.catb.org/~esr/faqs/smart-questions.html

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          prbiswal
                          wrote on last edited by
                          #13

                          @Volker: where is the Vanilla sources ?
                          i downloaded the pre compiled version of qt 4.8.0 from http://qt.nokia.com/downloads/downloads#qt-lib

                          Plz give me a link from where i can download.

                          Regards,
                          Pradeep

                          1 Reply Last reply
                          0
                          • G Offline
                            G Offline
                            goetz
                            wrote on last edited by
                            #14

                            [quote author="Pradeep Biswal" date="1326885211"]@Volker: where is the Vanilla sources ?
                            i downloaded the pre compiled version of qt 4.8.0 from http://qt.nokia.com/downloads/downloads#qt-lib

                            Plz give me a link from where i can download.

                            [/quote]

                            Search for "source" on that page....

                            bq. Here is the latest version of the Qt libraries. The edition you download here must match the OS you have your development system on.
                            The source code is available as a zip (261 MB) or a tar.gz (228 MB). Or visit the repository at qt.gitorious.org/qt.

                            http://www.catb.org/~esr/faqs/smart-questions.html

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              prbiswal
                              wrote on last edited by
                              #15

                              I have downloaded the source as qt-everywhere-opensource-src-4.8.0.zip and configured for static.

                              Now while building its giving me error as

                              LINK : fatal error LNK1181: cannot open input file 'qsqlite.lib'

                              and i searched and could not found the qsqlite.lib or dll in that dir.

                              where as in installed other qtsdk say qtsdk 4.7.4 has sqlite libs as C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\plugins\sqldrivers\qsqlite4.lib and dll.

                              how to resolve this linking error?

                              Regards,
                              Pradeep

                              1 Reply Last reply
                              0
                              • P Offline
                                P Offline
                                prbiswal
                                wrote on last edited by
                                #16

                                to resolve the above error i am following the below link.. let's see if it resolves the error

                                http://developer.qt.nokia.com/doc/qt-4.8/sql-driver.html#qsqlite

                                Regards,
                                Pradeep

                                1 Reply Last reply
                                0
                                • P Offline
                                  P Offline
                                  prbiswal
                                  wrote on last edited by
                                  #17

                                  it did not solve the problem. still i am getting the same error as

                                  link /LIBPATH:"c:\Qt\src\qt-everywhere-opensource-src-4.8.0\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /MANIFEST /MANIFESTFILE:".obj\installer.intermediate.manifest" /OUT:..\lib\installer.dll @C:\Users\prbiswal\AppData\Local\Temp\installer.dll.6264.62993.jom
                                  LINK : fatal error LNK1181: cannot open input file 'qsqlite.lib'

                                  Need your help to resolve this.

                                  Regards,
                                  Pradeep

                                  1 Reply Last reply
                                  0
                                  • P Offline
                                    P Offline
                                    prbiswal
                                    wrote on last edited by
                                    #18

                                    it did not solve the problem :

                                    its giving the same error as

                                    link /LIBPATH:"c:\Qt\src\qt-everywhere-opensource-src-4.8.0\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /MANIFEST /MANIFESTFILE:".obj\installer.intermediate.manifest" /OUT:..\lib\installer.dll @C:\Users\prbiswal\AppData\Local\Temp\installer.dll.6264.62993.jom
                                    LINK : fatal error LNK1181: cannot open input file 'qsqlite.lib'

                                    Regards,
                                    Pradeep

                                    1 Reply Last reply
                                    0
                                    • P Offline
                                      P Offline
                                      prbiswal
                                      wrote on last edited by
                                      #19

                                      Hi All,

                                      Issue is resolved :)

                                      I will share how this worked...

                                      1. downloaded the qt 4.7.4 source using "maintain qt sdk" tool (can be found from windows>>start>>qtsdk>>maintain qt sdk). This basically downloads the source package for diff releases from the repository.
                                      2. once update/download is successful then you can find the source code and some tools under %installed Qt SDK 4.7.4%\QtSources\4.7.4\ (for me its under C:\QtSDK\QtSources\4.7.4)
                                      3. Now for Qt static release build just follow http://qt.gitorious.org/qt-labs/installer-framework/blobs/master/README

                                      and it works. i could able to create the single exe.

                                      Regards,
                                      Pradeep

                                      1 Reply Last reply
                                      0
                                      • P Offline
                                        P Offline
                                        prbiswal
                                        wrote on last edited by
                                        #20

                                        And yes now need to link to the latest qmake.exe

                                        Regards,
                                        Pradeep

                                        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