1

I've created an application using Qt in C++, the problem is that I need to statically link the dependencies within the executable and I don't really know how.

I've performed the following steps:

  • Added the -static flag to QMAKE_LFLAGS in qmake.conf
  • Recompiled the Qt sources
  • Added the new compiler in Qt Creator [created a kit containing my qt version and added it in the Projects Tab]
  • When I try to build my application, or even an example from Qt Creator, I receive the following output:

    18:04:10: Running steps for project test... 18:04:10: Starting: "C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\bin\qmake.exe" C:\my\qt\test\test.pro -r -spec win32-g++ "CONFIG+=debug" "CONFIG+=declarative_debug" "CONFIG+=qml_debug" Project ERROR: Unknown module(s) in QT: webkit webkitwidgets widgets gui core 18:04:10: The process "C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\bin\qmake.exe" exited with code 3. Error while building/deploying project test (kit: Static Kit) When executing step 'qmake' 18:04:10: Elapsed time: 00:00.

I guess I need to recompile with the dependencies listed in the error. Am I on the right track? It's the first time I'm doing static linking and I would appreciate input.

Shafik Yaghmour
  • 154,301
  • 39
  • 440
  • 740
alexg
  • 902
  • 11
  • 37

0 Answers0