Static build application with QtHttpServer
Unsolved
General and Desktop
-
Hello!
I'm using Qt 5.15 (static built from sources). Additionally i have built and installed QtHttpServer from qt-labs (for static and non-static version).
With non-static it build and works wonderful, but on static build i'm getting errors:C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServerC2EP7QObject+0x0): multiple definition of `QSslServer::QSslServer(QObject*)' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServerC2EP7QObject+0x0): first defined here C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServerC2EP7QObject+0x0): multiple definition of `QSslServer::QSslServer(QObject*)' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServerC2EP7QObject+0x0): first defined here C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServerD2Ev+0x0): multiple definition of `QSslServer::~QSslServer()' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServerD2Ev+0x0): first defined here C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServerD2Ev+0x0): multiple definition of `QSslServer::~QSslServer()' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServerD2Ev+0x0): first defined here C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServerD0Ev+0x0): multiple definition of `QSslServer::~QSslServer()' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServerD0Ev+0x0): first defined here C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServer18incomingConnectionEx+0x0): multiple definition of `QSslServer::incomingConnection(long long)' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServer18incomingConnectionEx+0x0): first defined here C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServer19setSslConfigurationERK17QSslConfiguration+0x0): multiple definition of `QSslServer::setSslConfiguration(QSslConfiguration const&)' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(qsslserver.o):qsslserver.cpp:(.text$_ZN10QSslServer19setSslConfigurationERK17QSslConfiguration+0x0): first defined here C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(moc_qsslserver.o):moc_qsslserver.cpp:(.text$_ZNK10QSslServer10metaObjectEv+0x0): multiple definition of `QSslServer::metaObject() const' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(moc_qsslserver_p.o):moc_qsslserver_p.cpp:(.text$_ZNK10QSslServer10metaObjectEv+0x0): first defined here C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(moc_qsslserver.o):moc_qsslserver.cpp:(.text$_ZN10QSslServer18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv+0x0): multiple definition of `QSslServer::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(moc_qsslserver_p.o):moc_qsslserver_p.cpp:(.text$_ZN10QSslServer18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv+0x0): first defined here C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(moc_qsslserver.o):moc_qsslserver.cpp:(.text$_ZN10QSslServer11qt_metacastEPKc+0x0): multiple definition of `QSslServer::qt_metacast(char const*)' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(moc_qsslserver_p.o):moc_qsslserver_p.cpp:(.text$_ZN10QSslServer11qt_metacastEPKc+0x0): first defined here C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(moc_qsslserver.o):moc_qsslserver.cpp:(.text$_ZN10QSslServer11qt_metacallEN11QMetaObject4CallEiPPv+0x0): multiple definition of `QSslServer::qt_metacall(QMetaObject::Call, int, void**)' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(moc_qsslserver_p.o):moc_qsslserver_p.cpp:(.text$_ZN10QSslServer11qt_metacallEN11QMetaObject4CallEiPPv+0x0): first defined here C:\Qt\Qt-5.15.0-static\lib\libQt5SslServer.a(moc_qsslserver.o):moc_qsslserver.cpp:(.rdata$_ZN10QSslServer16staticMetaObjectE+0x0): multiple definition of `QSslServer::staticMetaObject' C:\Qt\Qt-5.15.0-static\lib\libQt5WebSockets.a(moc_qsslserver_p.o):moc_qsslserver_p.cpp:(.rdata$_ZN10QSslServer16staticMetaObjectE+0x0): first defined here collect2.exe: error: ld returned 1 exit status mingw32-make[1]: *** [Makefile.Release:485: ../build-Release/groundcontrolserver.exe] Error 1 mingw32-make: *** [Makefile:45: release] Error 2
How can i resolve this problem?
-
usually in Qt 5 I use script like this
qmake ../qt5/qtcharts/qtcharts.pro INCLUDEPATH+=../qt5/qtcharts/include/QtCharts CONFIG+=release
make -j8
make install
And there will statically build qtcharts.
I want to do the same with QtHttpServer. But I can't find any .pro files in qthttpserver/src
How I can build QtHttpServer with Qt 6? -
@DungeonLords hi from the looks of the source tree you can use either qmake or cmake. The CMakeLists.txt is geared for Qt 6.