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. Qt 5.2.0 static linking
Qt 6.11 is out! See what's new in the release blog

Qt 5.2.0 static linking

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.2k Views 1 Watching
  • 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.
  • G Offline
    G Offline
    gaminn
    wrote on last edited by
    #1

    Hello,
    I succesfully bulit Qt 5.2.0 static libs for MinGW. I added this configuration (Qt 5.2.0 static to Qt Creator) and I'm able to build my project under this configuration. However, the resulting exe still depends on Qt libraries (Qt5Core). How to fix it?

    This is compile output:

    @
    20:38:42: Running steps for project KinetisPinParser...
    20:38:42: Starting: "D:\Qt\Tools\mingw48_32\bin\mingw32-make.exe" clean
    D:/Qt/Tools/mingw48_32/bin/mingw32-make -f Makefile.Release clean
    mingw32-make[1]: Entering directory 'D:/SOURCE/Project/Qt/build-KinetisPinParser-Desktop_Qt_5_2_0_static_MinGW_4_8_32bit2-Release'
    del release\main.o
    mingw32-make[1]: Leaving directory 'D:/SOURCE/Project/Qt/build-KinetisPinParser-Desktop_Qt_5_2_0_static_MinGW_4_8_32bit2-Release'
    D:/Qt/Tools/mingw48_32/bin/mingw32-make -f Makefile.Debug clean
    mingw32-make[1]: Entering directory 'D:/SOURCE/Project/Qt/build-KinetisPinParser-Desktop_Qt_5_2_0_static_MinGW_4_8_32bit2-Release'
    del debug\main.o
    Could Not Find D:\SOURCE\Project\Qt\build-KinetisPinParser-Desktop_Qt_5_2_0_static_MinGW_4_8_32bit2-Release\debug\main.o
    mingw32-make[1]: Leaving directory 'D:/SOURCE/Project/Qt/build-KinetisPinParser-Desktop_Qt_5_2_0_static_MinGW_4_8_32bit2-Release'
    20:38:43: The process "D:\Qt\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
    20:38:43: Configuration unchanged, skipping qmake step.
    20:38:43: Starting: "D:\Qt\Tools\mingw48_32\bin\mingw32-make.exe"
    D:/Qt/Tools/mingw48_32/bin/mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory 'D:/SOURCE/Project/Qt/build-KinetisPinParser-Desktop_Qt_5_2_0_static_MinGW_4_8_32bit2-Release'
    g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_CORE_LIB -I..\KinetisPinParser -I"C:\5.2.0_static_mingw\include" -I"C:\5.2.0_static_mingw\include\QtCore" -I"release" -I"." -I"C:\5.2.0_static_mingw\mkspecs\win32-g++" -o release\main.o ..\KinetisPinParser\main.cpp
    g++ -Wl,-s -Wl,-subsystem,console -mthreads -o release\KinetisPinParser.exe release/main.o -LC:/5.2.0_static_mingw/lib -lQt5Core
    mingw32-make[1]: Leaving directory 'D:/SOURCE/Project/Qt/build-KinetisPinParser-Desktop_Qt_5_2_0_static_MinGW_4_8_32bit2-Release'
    20:38:45: The process "D:\Qt\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
    @

    It seems linker really links against static libs (-LC:/5.2.0_static_mingw/lib -lQt5Core).

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What do you mean by still depends on QtCore ? At run time Qt5Core.dll is still required ?

      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
      • G Offline
        G Offline
        gaminn
        wrote on last edited by
        #3

        Yes, at run time Qt5Core.dll is still required.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Might be a stupid question but: did you rebuild your project from scratch with your static Qt 5 ?

          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