redefiniton of 'QObject'
-
When I compiled my source code, I got this error only in macOS.
/Users/ckurdu/Qt/5.15.2/clang_64/lib/QtNetwork.framework/Headers/qsslconfiguration.h:82: error: redefinition of 'QObject' In file included from /Users/ckurdu/Projects/local/qtcms/output/x64/x84/release/modules/dashboard/dashboard_autogen/mocs_compilation.cpp:3: In file included from /Users/ckurdu/Projects/local/qtcms/output/x64/x84/release/modules/dashboard/dashboard_autogen/EWIEGA46WW/moc_dashboard.cpp:10: In file included from /Users/ckurdu/Projects/local/qtcms/output/x64/x84/release/modules/dashboard/dashboard_autogen/EWIEGA46WW/../../../../../../../../qtcms/modules/dashboard/dashboard.h:11: In file included from /Users/ckurdu/Projects/local/qtcms/qtcms/components/factory2/websocketserver/wsserver.h:4: In file included from /Users/ckurdu/Qt/5.15.2/clang_64/lib/QtWebSockets.framework/Headers/QWebSocketServer:1: In file included from /Users/ckurdu/Qt/5.15.2/clang_64/lib/QtWebSockets.framework/Headers/qwebsocketserver.h:51: In file included from /Users/ckurdu/Qt/5.15.2/clang_64/lib/QtNetwork.framework/Headers/QSslConfiguration:1: /Users/ckurdu/Qt/5.15.2/clang_64/lib/QtNetwork.framework/Headers/qsslconfiguration.h:82:24: error: redefinition of 'QObject' class Q_NETWORK_EXPORT QSslConfiguration ^ /Users/ckurdu/Projects/local/qtcms/qtcms/components/httpserver/httpconnectionhandler.h:22:29: note: expanded from macro 'QSslConfiguration' #define QSslConfiguration QObject ^ /Users/ckurdu/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qobject.h:127:21: note: previous definition is here class Q_CORE_EXPORT QObject ^Do you have any clue about it?
-
When I compiled my source code, I got this error only in macOS.
/Users/ckurdu/Qt/5.15.2/clang_64/lib/QtNetwork.framework/Headers/qsslconfiguration.h:82: error: redefinition of 'QObject' In file included from /Users/ckurdu/Projects/local/qtcms/output/x64/x84/release/modules/dashboard/dashboard_autogen/mocs_compilation.cpp:3: In file included from /Users/ckurdu/Projects/local/qtcms/output/x64/x84/release/modules/dashboard/dashboard_autogen/EWIEGA46WW/moc_dashboard.cpp:10: In file included from /Users/ckurdu/Projects/local/qtcms/output/x64/x84/release/modules/dashboard/dashboard_autogen/EWIEGA46WW/../../../../../../../../qtcms/modules/dashboard/dashboard.h:11: In file included from /Users/ckurdu/Projects/local/qtcms/qtcms/components/factory2/websocketserver/wsserver.h:4: In file included from /Users/ckurdu/Qt/5.15.2/clang_64/lib/QtWebSockets.framework/Headers/QWebSocketServer:1: In file included from /Users/ckurdu/Qt/5.15.2/clang_64/lib/QtWebSockets.framework/Headers/qwebsocketserver.h:51: In file included from /Users/ckurdu/Qt/5.15.2/clang_64/lib/QtNetwork.framework/Headers/QSslConfiguration:1: /Users/ckurdu/Qt/5.15.2/clang_64/lib/QtNetwork.framework/Headers/qsslconfiguration.h:82:24: error: redefinition of 'QObject' class Q_NETWORK_EXPORT QSslConfiguration ^ /Users/ckurdu/Projects/local/qtcms/qtcms/components/httpserver/httpconnectionhandler.h:22:29: note: expanded from macro 'QSslConfiguration' #define QSslConfiguration QObject ^ /Users/ckurdu/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qobject.h:127:21: note: previous definition is here class Q_CORE_EXPORT QObject ^Do you have any clue about it?
@CKurdu Looking at the source of these libraries QSslConfiguration in qsslconfiguration.h is specified if
QT_NO_SSLis not defined and that macro in httpconnectionhandler.h is defined whenQT_NO_SSLis defined, so... Qt includes think SSL is supported and that httpserver header thinks that it's not. I don't know how your project is configured but you've got a mismatch there. -
@CKurdu Looking at the source of these libraries QSslConfiguration in qsslconfiguration.h is specified if
QT_NO_SSLis not defined and that macro in httpconnectionhandler.h is defined whenQT_NO_SSLis defined, so... Qt includes think SSL is supported and that httpserver header thinks that it's not. I don't know how your project is configured but you've got a mismatch there.@Chris-Kawa Thank you,
You gave me a good hint and I think I solved the problem.As you wrote, the problem is related to unlinked SSL.