(this is on windows with mingw, for linux i link dynamically)
I’m trying to create a standalone binary for my application.
I’ve managed to build a static version of qt using a powershell script: http://qt-project.org/forums/viewthread/35655
I’ve managed to add my own qml to the binary using a qrc file.
So currently this is my deployment directory:
Deployment
myapp.exe
QtQuick
//copied from C:\Qt\Qt5.2.1\5.2.1\mingw48_32\qml
QtQuick.2
qmldir
If I remove any of these files, all I see is a white window
How can I use qmake/qrc to include these files as well?
EDIT: Here is my project file:
TARGET = nmgui
QT += core gui qml quick svg
CONFIG += static staticlib warn_on
QTPLUGIN += qsvg qtquick2plugin
QMAKE_CXXFLAGS += -std=c++11 \
-Wall -Werror -Wextra \
-pedantic-errors -Wwrite-strings \
-Woverloaded-virtual -Wredundant-decls \
-Wold-style-cast
# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp \
....
document.cpp
HEADERS += \
moduleq.hpp \
...
document.hpp
INCLUDEPATH = . ..
win32{
Debug {
LIBS += -L../nmlib/debug
PRE_TARGETDEPS += ../nmlib/debug/libnmlib.a
}
Release {
LIBS += -L../nmlib/release
PRE_TARGETDEPS += ../nmlib/release/libnmlib.a
}
} else {
LIBS += -L../nmlib
PRE_TARGETDEPS += ../nmlib/libnmlib.a
}
LIBS += -lnmlib
# Please do not modify the following two lines. Required for deployment.
include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
qtcAddDeployment()
RESOURCES += \
nmgui.qrc
↧