PDA

View Full Version : Standalone Windows Deployment



rhb327
25th April 2015, 21:57
I have a small application I've been developing in windows in development/debug mode using a MinGW 4.9.1. 32 bit compiler for Qt version 5.4.0. It compiles and runs as expected with debug flag on or off.

I'm interested in creating a standalone exe for windows. Thus, I followed the procedure using the windows-build-qt-static.ps1 PowerShell script without too much issue and I've got a static linked image of Qt 5.4.1 installed in C:\Qt\Static\5.4.1\. The script seems to download qt-everywhere-opensource-src-5.4.1.7z and start the build process.

Under tools I've added the C:\Qt\Static\5.4.1\bin\qmake.exe for Qt 5.4.1 Static and then created a kit. It used the same compiler (MinGW 4.9.1. 32 bit).

Now when I build using the new kit I get 100s of the same error...they are all similar to:

qstring.cpp:-1: error: undefined reference to `_Unwind_SjLj_Register'
File not found: qstring.cpp

It seems I've missed an obvious step here...please advise.

Thanks,
-Rich

rhb327
27th April 2015, 22:45
Still no joy...here's some more background:

1) It builds fine dynamically using: qmake.exe qt_pua.pro -r -spec win32-g++ "CONFIG+=debug"

2) It fails statically using: qmake.exe qt_pua.pro -r -spec win32-g++ "CONFIG+=static"

3) Both point to: MinGw 4.9.1. 32bit for the compiler by label. This is from the original Qt install under C:\Qt\Tools\MinGW (This is the path I put into the power shell script as well, perhaps I should make this C:\Qt\5.4\mingw491_32 ?).

4) Here's my PRO file:


QT += core gui sql printsupport
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = qt_pua
TEMPLATE = app
ICON =

SOURCES += main.cpp\
mainwindow.cpp \
aboutdialog.cpp \
../qcustomplot/qcustomplot.cpp \
preferencesdialog.cpp \
simple_dialog.cpp

HEADERS += mainwindow.h \
aboutdialog.h \
common.h \
../qcustomplot/qcustomplot.h \
preferencesdialog.h \
simple_dialog.h

FORMS += mainwindow.ui \
aboutdialog.ui \
preferencesdialog.ui \
simple_dialog.ui

RESOURCES += \
resources.qrc


5) I built Qt 5.4.1 statically using the following (from a power shell script and some reading, again I used C:\Qt\Tools\MinGW as the path):

-static -release -platform win32-g++ -prefix $QtDir -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sql-sqlite -no-openssl -no-opengl -opensource -confirm-license -make libs -nomake tools -nomake examples -Nomake tests"


6) I receive > 200 errros and they all are of the format:

qstring.cpp:-1: error: undefined reference to `_Unwind_SjLj_Unregister'\
File not found qstring.cpp

Any thoughts much appreciated.

Thanks,
-Rich