Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Static compile in Qt 5.5 (msvc2013)
QtWS25 Last Chance

Static compile in Qt 5.5 (msvc2013)

Scheduled Pinned Locked Moved Installation and Deployment
static qtcompilemsvc2013
8 Posts 3 Posters 4.7k 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.
  • M Offline
    M Offline
    MohammadReza
    wrote on 15 Sept 2015, 06:57 last edited by
    #1

    Hi everybody,
    I know my question is duplicate but I so confused. I am searching some hours but can not solve my problem. :(

    I installed Qt 5.5.0 in windows. 32 and 64 bit version of Qt. My compiler is Visual Studio 2013.
    I want to compile my projects statically (no need to set dlls, etc beside the exe file) (Only for release output not debug ouptut)

    Can you guide me step by step?
    Thanks a lot.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 15 Sept 2015, 07:22 last edited by
      #2

      Hi,

      The build process is explained here and the static part there in Qt's documentation.

      Be aware of the licensing implication that comes with a static build.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply 16 Sept 2015, 02:08
      0
      • S SGaist
        15 Sept 2015, 07:22

        Hi,

        The build process is explained here and the static part there in Qt's documentation.

        Be aware of the licensing implication that comes with a static build.

        M Offline
        M Offline
        MohammadReza
        wrote on 16 Sept 2015, 02:08 last edited by
        #3

        @SGaist Hi, Thanks for your reply.

        I followed the first link but have a problem. In step 3, when I create a qt5vars.cmd in desktop and run it, I get this error:

        C:\Windows\System32>C:\Users\---\Desktop\qt5vars.cmd
        
        C:\Windows\System32>REM Set up \Microsoft Visual Studio 2013, where <arch> is \c
         amd64, \c x86, etc.
        The syntax of the command is incorrect.
        
        C:\Windows\System32>CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
        \vcvarsall.bat" <arch>
        
        C:\Windows\System32>
        

        Here is the content of qt5vars.cmd:

        REM Set up \Microsoft Visual Studio 2013, where <arch> is \c amd64, \c x86, etc.
        CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" <arch>
        SET _ROOT=C:\Qt\Qt5.5.0-32bit\5.5\Src
        SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
        REM Uncomment the below line when using a git checkout of the source repository
        REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH%
        SET QMAKESPEC=win32-msvc2013
        SET _ROOT=
        
        1 Reply Last reply
        0
        • J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 16 Sept 2015, 05:02 last edited by
          #4

          In the first line of the script you can see: "where <arch> is \c amd64, \c x86, etc"
          So, <arch> is just a place-holder, you have to replace it with the architecture name, for example x86.
          Like this: CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • M Offline
            M Offline
            MohammadReza
            wrote on 16 Sept 2015, 06:02 last edited by
            #5

            Thanks but another problem:
            When I use this command:
            configure -static -release -platform win32-msvc2013
            After accepting of the terms of licence this error occurs:

            Creating qmake...
            execute: File or path is not found (nmake)
            execute: File or path is not found (nmake)
            Cleaning qmake failed, return code -1
            
            1 Reply Last reply
            0
            • M Offline
              M Offline
              MohammadReza
              wrote on 16 Sept 2015, 06:41 last edited by
              #6

              I used Developer Command Prompt for VS2013 instead of Windows Command Prompt
              and now it is working but now a question:
              How can I build my project statically in Qt Creator.
              I added CONFIG += staticbut does not work.

              J 1 Reply Last reply 16 Sept 2015, 08:12
              0
              • M MohammadReza
                16 Sept 2015, 06:41

                I used Developer Command Prompt for VS2013 instead of Windows Command Prompt
                and now it is working but now a question:
                How can I build my project statically in Qt Creator.
                I added CONFIG += staticbut does not work.

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 16 Sept 2015, 08:12 last edited by
                #7

                @MohammadReza I never used statically built Qt. What exactly does not work? Any error messages?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 16 Sept 2015, 22:32 last edited by
                  #8

                  Did you create a kit that uses your static Qt build ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  8/8

                  16 Sept 2015, 22:32

                  • Login

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