1

I am coming for Visual Studio word where you just change the project settings to static or dynamic linking so you application will not need framework dlls to run in on another machine. How do I do that in Qt?

I am following http://doc.qt.io/qt-5/windows-deployment.html but it is that helpful.

It says:

cd C:\path\to\Qt
configure -static <any other options you need>

But c:\Qt is a root folder (default in my case) and configure command is not recognized. I went to c:\Qt\5.3 and still the same case. Also what am I suppose to fill for < if anything? (I am not not filling it and hope it doesn’t mess up)

Do you really have to go command line to do that..is that the only way? I also read few say I need to add this line to .pro file

CONFIG += static

But this doesn’t do anything as well.

How do I link statically?

zar
  • 11,361
  • 14
  • 96
  • 178
  • Are you sure there is a `configure.exe` in your `C:\Qt\5.3` directory? Ensure you have the proper sources downloaded that comes with it. – cziemba Jan 16 '15 at 19:14
  • I searched and the only place I have `configure.exe` under my root `c:\Qt` is `C:\Qt\5.2.1\Src\qtbase`, does that make any sense? Should I just run it there? – zar Jan 16 '15 at 19:37
  • Yes, and It seems it is recommended to run the configure step from within the `Visual Studio Command Prompt` (should be under visual studio tools in start menu?) – cziemba Jan 16 '15 at 19:47
  • I am not using Visual studio, I am only using Qt Creator. – zar Jan 16 '15 at 19:58
  • @zadane Then which compiler are you using? – MrEricSir Jan 16 '15 at 20:41
  • @MrEricSir oh yea its VS2010 compiler, I am just not using VS2010 IDE. – zar Jan 16 '15 at 20:46
  • 3
    possible duplicate of [Qt static linking and deployment](http://stackoverflow.com/questions/1011197/qt-static-linking-and-deployment) – Nicolas Holthaus Jan 16 '15 at 20:49
  • first of all make sure your qt version is static then add – alrawab Jan 18 '15 at 20:22
  • We did that I my company in the past. But we stopped doing it; it was just too much trouble. – Johan Råde Jan 18 '15 at 20:28
  • 1. Compile Qt Source as Static. 2. Make sure your Qt Creator is referencing paths to your newly compiled static qt binaries instead of the default locations. 3. Add `config+=static` in your `TEMPLATE=app` PRO file. That's a ton of legwork, but it should work if you do it all. The biggest annoyance is compiling qt and updating Qt Creator settings per-project. – kayleeFrye_onDeck Apr 05 '17 at 00:13

1 Answers1

-2

first of all make sure your Qt version is static . then add CONFIG += static to your .pro file .

alrawab
  • 217
  • 3
  • 8