Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Static linking in Qt Comercial SDK

    General and Desktop
    2
    13
    3834
    Loading More Posts
    • 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.
    • Z
      zolidznake last edited by

      Hi,

      I am unable to statically linking my project

      i have put CONFIG += static in my .pro file but it doesn't make the linking

      and also i didn't successfuly configured the Qt static :(

      any help would be apreciated

                                                           thank you in advance
      
      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        You have to compile Qt statically before you can link those libs into your binary.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • Z
          zolidznake last edited by

          i have installed Qt Commercial SDK but i opened qt command prompt and it saying

          Setting up environment for Qt usage...
          Remember to call vcvarsall.bat to complete environment setup!

          D:\QtCommercialSDK\Desktop\483\vs2008>

          i cannot run configure :(

          1 Reply Last reply Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            I don't know about Commercial SDK, but the old Nokia one had no sources prepared for compilation. You need to separately download commercial Qt source package and compile it on your machine with -static and -no-exceptions.

            (Z(:^

            1 Reply Last reply Reply Quote 0
            • sierdzio
              sierdzio Moderators last edited by

              These are the exact lines I used to compile Qt statically:
              @
              ./configure -prefix $PWD -nomake demos -nomake examples -nomake tests -release -static -no-exceptions -no-webkit -qt-zlib -qt-libpng -qt-libjpeg -arch x86 -dont-process -no-qt3support
              bin/qmake projects.pro QT_BUILD_PARTS="libs" JAVASCRIPTCORE_JIT="yes"
              make -j5
              @

              (Z(:^

              1 Reply Last reply Reply Quote 0
              • Z
                zolidznake last edited by

                thank you ...and now..how can i build my project from qtCreator statically ?

                1 Reply Last reply Reply Quote 0
                • sierdzio
                  sierdzio Moderators last edited by

                  First, make sure you are using the newly build Qt (Options->Build & Run->Qt Versions, and verify in project options). Then, as you noted:
                  @
                  // your .pro file if you are using qmake
                  CONFIG += static
                  @

                  Adding the static objects explicitly to LIBS variable is a good idea, too. Here's a link with example: "LINK":http://qt-project.org/doc/qt-4.8/deployment-mac.html#static-linking.

                  Some people add other things here, too. You need to ask uncle Google for that.

                  (Z(:^

                  1 Reply Last reply Reply Quote 0
                  • Z
                    zolidznake last edited by

                    I have this at the effective qmake call :

                    qmake.exe C:\Users\zolidznake\Desktop\silviu-saved-sources\HardwareInformation\HardwareInformation.pro -r -spec win32-msvc2008 "CONFIG+=debug" "CONFIG+=declarative_debug"

                    it will take automatically from my .pro file the CONFIG += static ?

                    thank you for helping ...

                    1 Reply Last reply Reply Quote 0
                    • sierdzio
                      sierdzio Moderators last edited by

                      IIRC, qmake treats .pro files as more important than the command line arguments, so it should pick it up, yes.

                      (Z(:^

                      1 Reply Last reply Reply Quote 0
                      • Z
                        zolidznake last edited by

                        when i try to build i get this :(

                        :-1: error: LNK1104: cannot open file 'c:\Qt\4.8.3-vs\lib\QtGuid.lib'

                        1 Reply Last reply Reply Quote 0
                        • sierdzio
                          sierdzio Moderators last edited by

                          Well, is this file available at that location?

                          (Z(:^

                          1 Reply Last reply Reply Quote 0
                          • Z
                            zolidznake last edited by

                            in build debug doesn't work...i builded the release ...it works fine...thank you much for your help !

                            1 Reply Last reply Reply Quote 0
                            • sierdzio
                              sierdzio Moderators last edited by

                              Nice, I'm glad it worked :)

                              (Z(:^

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post