Making a standalone Qt application on Windows
-
Hi. I've been trying to make a standalone Qt application for Windows, but I seem to have no luck. I looked on Google, and found that you can make a static version of Qt, and it will make a standalone application, but I can't seem to get it working.
Here's the page link I found this on: https://stackoverflow.com/questions/22291017/download-qt-static-build-on-windows#
I use Qt version 5.15.2 and they used 5.2.1. Does that make a difference?
On the command "mingw32-make -j 4" it gave me an error:mingw32-make: *** No targets specified and no makefile found. Stop.
-
Hi,
Did you properly call configure ?
By the way, did you also check the constraints of the GPL/LGPL licenses with regard to static linking ?
-
I ran the configure again in the same folder I ran it as first, and I got a message that I could actually build it now. So I ran it, and while it was building, it gave me an error:
In file included from declarativemaps\qdeclarativepolylinemapitem.cpp:38: declarativemaps\qdeclarativepolylinemapitem_p_p.h:381:17: error: 'const char* MapPolylineShaderLineStrip::vertexShader() const' marked 'override', but does not override const char *vertexShader() const override { ^~~~~~~~~~~~ declarativemaps\qdeclarativepolylinemapitem_p_p.h:397:17: error: 'const char* MapPolylineShaderLineStrip::fragmentShader() const' marked 'override', but does not override const char *fragmentShader() const override { ^~~~~~~~~~~~~~ declarativemaps\qdeclarativepolylinemapitem_p_p.h: In member function 'virtual void MapPolylineShaderLineStrip::initialize()': declarativemaps\qdeclarativepolylinemapitem_p_p.h:411:23: error: 'program' was not declared in this scope m_matrix_id = program()->uniformLocation("qt_Matrix"); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem_p_p.h: At global scope: declarativemaps\qdeclarativepolylinemapitem_p_p.h:435:17: error: 'const char* MapPolylineShaderExtruded::vertexShader() const' marked 'override', but does not override const char *vertexShader() const override ^~~~~~~~~~~~ declarativemaps\qdeclarativepolylinemapitem_p_p.h:440:17: error: 'const char* MapPolylineShaderExtruded::fragmentShader() const' marked 'override', but does not override const char *fragmentShader() const override ^~~~~~~~~~~~~~ declarativemaps\qdeclarativepolylinemapitem_p_p.h: In member function 'virtual void MapPolylineShaderExtruded::initialize()': declarativemaps\qdeclarativepolylinemapitem_p_p.h:455:23: error: 'program' was not declared in this scope m_matrix_id = program()->uniformLocation("qt_Matrix"); ^~~~~~~ In file included from ..\..\include\QtLocation\5.15.2/QtLocation/private/qdeclarativepolygonmapitem_p_p.h:1, from declarativemaps\qdeclarativerectanglemapitem_p_p.h:53, from declarativemaps\qdeclarativepolylinemapitem.cpp:39: C:/Qt/5.15.2-static/qtlocation/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h: At global scope: C:/Qt/5.15.2-static/qtlocation/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h:152:17: error: 'const char* MapPolygonShader::vertexShader() const' marked 'override', but does not override const char *vertexShader() const override { ^~~~~~~~~~~~ C:/Qt/5.15.2-static/qtlocation/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h:168:17: error: 'const char* MapPolygonShader::fragmentShader() const' marked 'override', but does not override const char *fragmentShader() const override { ^~~~~~~~~~~~~~ C:/Qt/5.15.2-static/qtlocation/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h: In member function 'virtual void MapPolygonShader::initialize()': C:/Qt/5.15.2-static/qtlocation/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h:186:23: error: 'program' was not declared in this scope m_matrix_id = program()->uniformLocation("qt_Matrix"); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp: In member function 'virtual void MapPolylineShaderLineStrip::updateState(const QSGMaterialShader::RenderState&, QSGMaterial*, QSGMaterial*)': declarativemaps\qdeclarativepolylinemapitem.cpp:1552:9: error: 'program' was not declared in this scope program()->setUniformValue(m_color_id, v); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp:1557:9: error: 'program' was not declared in this scope program()->setUniformValue(m_matrix_id, state.projectionMatrix()); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp:1560:5: error: 'program' was not declared in this scope program()->setUniformValue(m_mapProjection_id, geoProjection); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp: In member function 'virtual void MapPolylineShaderExtruded::updateState(const QSGMaterialShader::RenderState&, QSGMaterial*, QSGMaterial*)': declarativemaps\qdeclarativepolylinemapitem.cpp:1768:9: error: 'program' was not declared in this scope program()->setUniformValue(m_color_id, v); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp:1773:9: error: 'program' was not declared in this scope program()->setUniformValue(m_matrix_id, state.projectionMatrix()); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp:1777:5: error: 'program' was not declared in this scope program()->setUniformValue(m_mapProjection_id, geoProjection); ^~~~~~~ mingw32-make[4]: *** [Makefile.Release:35989: .obj/release/qdeclarativepolylinemapitem.o] Error 1 mingw32-make[4]: Leaving directory 'C:/Qt/5.15.2-static/qtlocation/src/location' mingw32-make[3]: *** [Makefile:49: release-all] Error 2 mingw32-make[3]: Leaving directory 'C:/Qt/5.15.2-static/qtlocation/src/location' mingw32-make[2]: *** [Makefile:184: sub-location-make_first] Error 2 mingw32-make[2]: Leaving directory 'C:/Qt/5.15.2-static/qtlocation/src' mingw32-make[1]: *** [Makefile:52: sub-src-make_first] Error 2 mingw32-make[1]: Leaving directory 'C:/Qt/5.15.2-static/qtlocation' mingw32-make: *** [Makefile:819: module-qtlocation-make_first] Error 2
I didn't think much of it, and ran "mingw32-make install", but I got another error:
In file included from declarativemaps\qdeclarativepolylinemapitem.cpp:38: declarativemaps\qdeclarativepolylinemapitem_p_p.h:381:17: error: 'const char* MapPolylineShaderLineStrip::vertexShader() const' marked 'override', but does not override const char *vertexShader() const override { ^~~~~~~~~~~~ declarativemaps\qdeclarativepolylinemapitem_p_p.h:397:17: error: 'const char* MapPolylineShaderLineStrip::fragmentShader() const' marked 'override', but does not override const char *fragmentShader() const override { ^~~~~~~~~~~~~~ declarativemaps\qdeclarativepolylinemapitem_p_p.h: In member function 'virtual void MapPolylineShaderLineStrip::initialize()': declarativemaps\qdeclarativepolylinemapitem_p_p.h:411:23: error: 'program' was not declared in this scope m_matrix_id = program()->uniformLocation("qt_Matrix"); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem_p_p.h: At global scope: declarativemaps\qdeclarativepolylinemapitem_p_p.h:435:17: error: 'const char* MapPolylineShaderExtruded::vertexShader() const' marked 'override', but does not override const char *vertexShader() const override ^~~~~~~~~~~~ declarativemaps\qdeclarativepolylinemapitem_p_p.h:440:17: error: 'const char* MapPolylineShaderExtruded::fragmentShader() const' marked 'override', but does not override const char *fragmentShader() const override ^~~~~~~~~~~~~~ declarativemaps\qdeclarativepolylinemapitem_p_p.h: In member function 'virtual void MapPolylineShaderExtruded::initialize()': declarativemaps\qdeclarativepolylinemapitem_p_p.h:455:23: error: 'program' was not declared in this scope m_matrix_id = program()->uniformLocation("qt_Matrix"); ^~~~~~~ In file included from ..\..\include\QtLocation\5.15.2/QtLocation/private/qdeclarativepolygonmapitem_p_p.h:1, from declarativemaps\qdeclarativerectanglemapitem_p_p.h:53, from declarativemaps\qdeclarativepolylinemapitem.cpp:39: C:/Qt/5.15.2-static/qtlocation/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h: At global scope: C:/Qt/5.15.2-static/qtlocation/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h:152:17: error: 'const char* MapPolygonShader::vertexShader() const' marked 'override', but does not override const char *vertexShader() const override { ^~~~~~~~~~~~ C:/Qt/5.15.2-static/qtlocation/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h:168:17: error: 'const char* MapPolygonShader::fragmentShader() const' marked 'override', but does not override const char *fragmentShader() const override { ^~~~~~~~~~~~~~ C:/Qt/5.15.2-static/qtlocation/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h: In member function 'virtual void MapPolygonShader::initialize()': C:/Qt/5.15.2-static/qtlocation/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h:186:23: error: 'program' was not declared in this scope m_matrix_id = program()->uniformLocation("qt_Matrix"); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp: In member function 'virtual void MapPolylineShaderLineStrip::updateState(const QSGMaterialShader::RenderState&, QSGMaterial*, QSGMaterial*)': declarativemaps\qdeclarativepolylinemapitem.cpp:1552:9: error: 'program' was not declared in this scope program()->setUniformValue(m_color_id, v); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp:1557:9: error: 'program' was not declared in this scope program()->setUniformValue(m_matrix_id, state.projectionMatrix()); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp:1560:5: error: 'program' was not declared in this scope program()->setUniformValue(m_mapProjection_id, geoProjection); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp: In member function 'virtual void MapPolylineShaderExtruded::updateState(const QSGMaterialShader::RenderState&, QSGMaterial*, QSGMaterial*)': declarativemaps\qdeclarativepolylinemapitem.cpp:1768:9: error: 'program' was not declared in this scope program()->setUniformValue(m_color_id, v); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp:1773:9: error: 'program' was not declared in this scope program()->setUniformValue(m_matrix_id, state.projectionMatrix()); ^~~~~~~ declarativemaps\qdeclarativepolylinemapitem.cpp:1777:5: error: 'program' was not declared in this scope program()->setUniformValue(m_mapProjection_id, geoProjection); ^~~~~~~ mingw32-make[4]: *** [Makefile.Release:35989: .obj/release/qdeclarativepolylinemapitem.o] Error 1 mingw32-make[4]: Leaving directory 'C:/Qt/5.15.2-static/qtlocation/src/location' mingw32-make[3]: *** [Makefile:74: release-debug-install] Error 2 mingw32-make[3]: Leaving directory 'C:/Qt/5.15.2-static/qtlocation/src/location' mingw32-make[2]: *** [Makefile:196: sub-location-install_subtargets] Error 2 mingw32-make[2]: Leaving directory 'C:/Qt/5.15.2-static/qtlocation/src' mingw32-make[1]: *** [Makefile:64: sub-src-install_subtargets] Error 2 mingw32-make[1]: Leaving directory 'C:/Qt/5.15.2-static/qtlocation' mingw32-make: *** [Makefile:831: module-qtlocation-install_subtargets] Error 2
EDIT: And I also didn't add "-j 4" when I executed the "mingw32-make" command.
-
Where did you get Qt's sources from ?
-
Your error looks odd.
I would nuke that build and extract the sources again.
Also, please use an out of source build so you don't pollute the source tree and can restart more easily.
-
Your error looks odd.
I would nuke that build and extract the sources again.
Also, please use an out of source build so you don't pollute the source tree and can restart more easily.
-
Literally what is written: call configure from a folder outside of the sources.
-
@SGaist ok, but how do I call configure from a folder that doesn't have the configure.bat file?
@Sucharek said in Making a standalone Qt application on Windows:
but how do I call configure from a folder that doesn't have the configure.bat file?
By providing path to it? Either relative to your build folder or absolute path:
../QT_SRC_FOLDER/configure
-
@Sucharek said in Making a standalone Qt application on Windows:
but how do I call configure from a folder that doesn't have the configure.bat file?
By providing path to it? Either relative to your build folder or absolute path:
../QT_SRC_FOLDER/configure
-
Hi, so I built it again, and got the same error. The error is from QLocation, to on configure can I use "-nomake qlocation", or something like that? Also, the build takes about 10 hours, so that's why I'm responding after a very long time.
-
Hi @jsulm, ok I'll try that. Also, I ran the mingw32-make with -i (ignore errors), and it just ignored the qlocation errors, and don't see any more of them. I don't need QLocation, so it's fine if I don't have it. If it wouldn't work, I'll try the -configure myself to see if I can clear some more thing out. After the compile is done, I'll update you if I have any more issues.
-
Hi, so I ran the installation with my own command, which took about 40 hours, installed it, but got the same error in Qt Creator. No QML utility installed. Do I need to run something else, not "mingw32-make install"?
@Sucharek said in Making a standalone Qt application on Windows:
No QML utility installed
I don't know what QML utility. Does it work? I mean: can you build your apps using this Qt installation?