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. Static linking in Qt Comercial SDK

Static linking in Qt Comercial SDK

Scheduled Pinned Locked Moved General and Desktop
13 Posts 2 Posters 4.3k Views
  • 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.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on last edited by
    #2

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

    (Z(:^

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      zolidznake
      wrote on last edited by
      #3

      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
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #4

        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
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #5

          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
          0
          • Z Offline
            Z Offline
            zolidznake
            wrote on last edited by
            #6

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

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #7

              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
              0
              • Z Offline
                Z Offline
                zolidznake
                wrote on last edited by
                #8

                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
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #9

                  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
                  0
                  • Z Offline
                    Z Offline
                    zolidznake
                    wrote on last edited by
                    #10

                    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
                    0
                    • sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #11

                      Well, is this file available at that location?

                      (Z(:^

                      1 Reply Last reply
                      0
                      • Z Offline
                        Z Offline
                        zolidznake
                        wrote on last edited by
                        #12

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

                        1 Reply Last reply
                        0
                        • sierdzioS Offline
                          sierdzioS Offline
                          sierdzio
                          Moderators
                          wrote on last edited by
                          #13

                          Nice, I'm glad it worked :)

                          (Z(:^

                          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