Qt 5.2.0 static linking



  • 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).


  • Lifetime Qt Champion

    Hi,

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



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


  • Lifetime Qt Champion

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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.