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 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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
      0
      • SGaistS SGaist

        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 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
        • jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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 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 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.

              jsulmJ 1 Reply Last reply
              0
              • M MohammadReza

                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.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on 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
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 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

                  • Login

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