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. QtCore.dll missing error after build static app
QtWS25 Last Chance

QtCore.dll missing error after build static app

Scheduled Pinned Locked Moved Solved General and Desktop
buildbuilding staticdeploymentwindowsstatic qt
6 Posts 3 Posters 5.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.
  • I Offline
    I Offline
    IMAN4K
    wrote on 11 Nov 2016, 12:04 last edited by IMAN4K 11 Dec 2016, 05:20
    #1

    Hi everyone.
    I've successfully built static qt based on Document and WiKi
    With these options :

    configure -release -opensource -static -platform win32-msvc2013
    -qt-sql-odbc -confirm-license -nomake examples -nomake tests -qt-zlib
    
    nmake
    nmake install
    

    Now i have a 5GB Qt directory called D:\Qt5.7 and also have qt in my environment.

    After trying to build my project using this command :

    qmake -config release App.pro
    nmake
    

    I get log :

    link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /debug /opt:ref
    /INCREMENTAL:NO /Debug /SUBSYSTEM:WINDOWS
    "/MANIFESTDEPENDENCY:type='win32'
    name='Microsoft.Windows.Common-Controls' version='6.0.0.0'
    publicKeyToken='6595b64144ccf1df' language=''
    processorArchitecture='
    '" /MANIFEST:embed /OUT:release\App.exe
    @C:\Users<user>\AppData\Local\Temp\nm5AE9.tmp

    Now i have a 15MB executable App.exe witch throw error after running :

    enter image description here

    I'm using Visual Studio 2013(nmake) + windows10 + Qt5.7 and .pro is this :

    TARGET       = App
    TEMPLATE     = app
    QT          += core gui widgets sql network printsupport
    CONFIG      += static
    LIBS        += -L$$PWD/quazip/lib -lquazip
    INCLUDEPATH += .
    RESOURCES   += app.qrc
    include($$PWD/breakpad/crash_handler.pri)
    
    QMAKE_CFLAGS_RELEASE +=/Zi
    QMAKE_LFLAGS_RELEASE +=/debug /opt:ref
    QMAKE_LFLAGS_RELEASE +=/INCREMENTAL:NO /Debug
    
    SOURCES += main.cpp\
        .
        .
        .
    
    HEADERS  += \
       .
       .
       .
    

    Dependency walker result :

    enter image description here

    What is the wrong ?

    K 1 Reply Last reply 11 Nov 2016, 14:00
    0
    • I IMAN4K
      11 Nov 2016, 12:04

      Hi everyone.
      I've successfully built static qt based on Document and WiKi
      With these options :

      configure -release -opensource -static -platform win32-msvc2013
      -qt-sql-odbc -confirm-license -nomake examples -nomake tests -qt-zlib
      
      nmake
      nmake install
      

      Now i have a 5GB Qt directory called D:\Qt5.7 and also have qt in my environment.

      After trying to build my project using this command :

      qmake -config release App.pro
      nmake
      

      I get log :

      link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /debug /opt:ref
      /INCREMENTAL:NO /Debug /SUBSYSTEM:WINDOWS
      "/MANIFESTDEPENDENCY:type='win32'
      name='Microsoft.Windows.Common-Controls' version='6.0.0.0'
      publicKeyToken='6595b64144ccf1df' language=''
      processorArchitecture='
      '" /MANIFEST:embed /OUT:release\App.exe
      @C:\Users<user>\AppData\Local\Temp\nm5AE9.tmp

      Now i have a 15MB executable App.exe witch throw error after running :

      enter image description here

      I'm using Visual Studio 2013(nmake) + windows10 + Qt5.7 and .pro is this :

      TARGET       = App
      TEMPLATE     = app
      QT          += core gui widgets sql network printsupport
      CONFIG      += static
      LIBS        += -L$$PWD/quazip/lib -lquazip
      INCLUDEPATH += .
      RESOURCES   += app.qrc
      include($$PWD/breakpad/crash_handler.pri)
      
      QMAKE_CFLAGS_RELEASE +=/Zi
      QMAKE_LFLAGS_RELEASE +=/debug /opt:ref
      QMAKE_LFLAGS_RELEASE +=/INCREMENTAL:NO /Debug
      
      SOURCES += main.cpp\
          .
          .
          .
      
      HEADERS  += \
         .
         .
         .
      

      Dependency walker result :

      enter image description here

      What is the wrong ?

      K Offline
      K Offline
      koahnig
      wrote on 11 Nov 2016, 14:00 last edited by
      #2

      @IMAN4K

      The docs for CONFIG say:
      static The target is a static library (lib only). The proper compiler flags will automatically be added to the project.

      Therefore, I guess you are still linking with the lib stubs for dlls. Make sure that you are using the qmake generated with the static lib compilation.

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

      I 1 Reply Last reply 11 Nov 2016, 14:10
      2
      • K koahnig
        11 Nov 2016, 14:00

        @IMAN4K

        The docs for CONFIG say:
        static The target is a static library (lib only). The proper compiler flags will automatically be added to the project.

        Therefore, I guess you are still linking with the lib stubs for dlls. Make sure that you are using the qmake generated with the static lib compilation.

        I Offline
        I Offline
        IMAN4K
        wrote on 11 Nov 2016, 14:10 last edited by
        #3

        @koahnig

        Make sure that you are using the qmake generated with the static lib compilation

        Yes i'm sure because while i have another qt installation (in another path) but just static bin path is in environment variable so i'm using qmake from D:\Qt5.7\qtbase\bin

        1 Reply Last reply
        0
        • I Offline
          I Offline
          IMAN4K
          wrote on 12 Nov 2016, 04:19 last edited by
          #4

          Could anyone help me please :(

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 12 Nov 2016, 08:53 last edited by
            #5

            Hi
            You can try to use it as a kit
            https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW#Using_the_Qt_static_environment

            "Using the Qt static environment with Qt Creator"

            Also I had to edit
            C:\Qt\Qt5_static\mkspecs\win32-g++\
            (for mingw)
            To make it use static.

            I build static 5.7 following this guide
            http://dimitris.apeiro.gr/2015/06/24/build-a-static-qt5-for-windows-by-compiling/

            1 Reply Last reply
            1
            • I Offline
              I Offline
              IMAN4K
              wrote on 12 Nov 2016, 09:19 last edited by
              #6

              Thanks @mrjj .
              The Problem was the Quazip that was linking to dynamic Qt libs witch Dependency walker won't show up at run time.

              First i should build it as static like so :

              TEMPLATE = lib
              CONFIG += qt warn_on
              QT -= gui
              DEFINES += QUAZIP_BUILD
              CONFIG += staticlib
              CONFIG(staticlib): DEFINES += QUAZIP_STATIC
              include(quazip.pri)
              

              Then i should link that in my .pro :

              .
              .
              .
              LIBS += -L$$PWD/quazip/ -lquazip
              INCLUDEPATH += $$PWD/quazip
              PRE_TARGETDEPS += $$PWD/quazip/quazip.lib
              DEFINES += QUAZIP_STATIC
              .
              .
              .
              
              1 Reply Last reply
              1

              2/6

              11 Nov 2016, 14:00

              topic:navigator.unread, 4
              • Login

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