Last Updated: February 25, 2016
·
1.434K
· robostx

Netbeans and QT - Static Linking (Windows)

If you want to distribute your aplication as a standalone executable (don't want to force users to install QT and MinGw on their machines) you should use static linking. Compares to shared libraries approach it makes executables huge and compilation take a lot more time. But then executables will be truly distributable (without installers and separate libraries). All dependencies will be included in single exe file.

To make it happen configure QT according to this document (http://doc.qt.digia.com/4.2/deployment-windows.html). In short, open terminal and execute (i change it for mingw compilers):

cd C:\path\to\T
configure -static <any other options if you need>
mingw32-make sub-src

It takes time - even up to 1 hour (sic!) so run it and do something else in the mean time.

Then, when it will be done run NetBeans and compile your project as usuall (now it can take minutes instead of seconds). As a result you get static linked dependencied executable.