Closed dan8551 closed 2 years ago
Please try the changes made my @alex-spataru raised in PR #231. Unfortunately we weren't able to include them successfully since they are breaking the Qt5-based build.
We remind you that qmqtt is basically out of development/support, so we are only accepting essential bug fixes but no new features.
@ejvr Do you have any other suggestion?
Please try the changes made my @alex-spataru raised in PR #231. Unfortunately we weren't able to include them successfully since they are breaking the Qt5-based build.
We remind you that qmqtt is basically out of development/support, so we are only accepting essential bug fixes but no new features.
@ejvr Do you have any other suggestion?
Tried PR #231 with the same issues as above.
Tricky question, the error messages are quite hard to read. It seems that the 'slots' pseudo keyword some of the headers is not recognized. For now, I would advice to use cmake instead of qmake when using QT 6. This seems to be the default these days.
I did some simple analysis: the QMQTT master branch compiles using QT6.2.3 and qmake. At least, on my setup.
@dan8551 your build log contains some weird errors, like this one:
make[2]: Entering directory '/home/dan/Documents/build-qmqtt-Desktop_Qt_6_2_3_GCC_64bit-Debug/src/mqtt'
g++ -c -pipe -g -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -Wno-format-overflow -Wsuggest-override -D_REENTRANT -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_QMQTT_LIB -DQT_BUILDING_QT -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_QML_DEBUG -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NETWORK_LIB -DQT_CORE_LIB -Wall -Wextra -Werror -Woverloaded-virtual -Wshadow -Wundef -Wfloat-equal -Wnon-virtual-dtor -Wpointer-arith -Wformat-security -Wno-long-long -Wno-variadic-macros -pedantic-errors -Wchar-subscripts -Wold-style-cast -Wcast-align -Wdouble-promotion -Wfloat-conversion -Wno-deprecated-copy -Wno-redundant-move -Wno-format-overflow -Wno-init-list-lifetime -Wzero-as-null-pointer-constant -I/home/dan/Documents/qmqtt/src/mqtt -I. -I/home/dan/Documents/qmqtt/src/mqtt -I../../include -I../../include/QtQmqtt -I../../include/QtQmqtt/1.0.0 -I../../include/QtQmqtt/1.0.0/QtQmqtt -I/home/dan/Qt/6.2.3/gcc_64/include -I/home/dan/Qt/6.2.3/gcc_64/include/QtNetwork -I/home/dan/Qt/6.2.3/gcc_64/include/QtCore -I.moc -I/home/dan/Qt/6.2.3/gcc_64/mkspecs/linux-g++ -DQT_NO_CAST_TO_ASCII=1 -DQT_NO_CAST_FROM_ASCII=1 -UQT_RESTRICTED_CAST_FROM_ASCII -DQT_NO_URL_CAST_FROM_STRING=1 -DQT_NO_CAST_FROM_BYTEARRAY=1 -DQT_NO_KEYWORDS=1 -DQT_USE_QSTRINGBUILDER -DQT_USE_FAST_OPERATOR_PLUS -Dsignals=int -Dslots=int -Demit=public: -Dforeach=public: -Dforever=public: -xc++
/home/dan/Documents/qmqtt/src/mqtt/qmqtt.h -o .obj/header_qmqtt.o
For some reason the compiler tries to compile a header file. I don't see why (maybe precompiled headers???). Also, there are a few strange defines passed to the compiler, especially -Dsignals=int -Dslots=int -Demit=public:
. Those seem to cause the compiler errors. I don't know where those defines come from, but I suspect that in this case qmqtt is not being built using qmake.pro
in the repo.
@ejvr the build is trying to compile completely from stock with no changes to your code or the compiler. Can I ask what your build environment is? The macOS environment is running on a M1 processor. No changes were made to either the compiler or the source.
I compiled on debian linux (version 11) with QT 6.2.3 (64 bits), and gcc 10.2.1.
Right now, I don't have access to Apple hardware, so I have no clue on how the debug this. Could you try to run a build from a command prompt and use qmake + make without any command line options?
I compiled on debian linux (version 11) with QT 6.2.3 (64 bits), and gcc 10.2.1.
Right now, I don't have access to Apple hardware, so I have no clue on how the debug this. Could you try to run a build from a command prompt and use qmake + make without any command line options?
I have the same setup as yours, but the same problem like @dan8551
@JuniorSuperTux Do you also see this in the build output: -Dsignals=int -Dslots=int -Demit=public:
? If so, there's a serious problem with the setup. No QT application will compile with those settings.
Regarding my earlier comments in this issue: did you try to use cmake? Alternatively, did you try to run the build with just qmake
and make
(so no extra options)?
EDIT: yet another question: how did you install qt6 on your system? afaik, there's no qt6 support in debian yet, which leaves 2 options: binary download or manual build.
The issue seems to be related to the makefile generated by qmake: it enables a feature where use of the signals
and slots
macros cause a compiler error. Instead those macros you should use QT_SIGNALS
and QT_SLOTS
. This is done to avoid problems with signal/slot patterns defined by other libraries such as boost.
I've create a pull request do fixes this. It also a warning about using 0
as null pointer (instead of nullptr
). In this particular setup the warning is promoted to a compiler error.
Should be fixed now.
When building on Linux (Ubuntu) and macOS the build fails.
Linux compiling with "Desktop Qt 6.2.3 GCC 64bit" macOS compiling with "Qt 6.2.3 for macOS"
The build compiles correctly on:
Compiler output from Linux: `13:51:58: Running steps for project qmqtt... 13:51:58: Starting: "/home/dan/Qt/6.2.3/gcc_64/bin/qmake" /home/dan/Documents/qmqtt/qmqtt.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug Info: creating stash file /home/dan/Documents/build-qmqtt-Desktop_Qt_6_2_3_GCC_64bit-Debug/.qmake.stash Info: creating cache file /home/dan/Documents/build-qmqtt-Desktop_Qt_6_2_3_GCC_64bit-Debug/.qmake.cache 13:51:58: The process "/home/dan/Qt/6.2.3/gcc_64/bin/qmake" exited normally. 13:51:58: Starting: "/usr/bin/make" -f /home/dan/Documents/build-qmqtt-Desktop_Qt_6_2_3_GCC_64bit-Debug/Makefile qmake_all cd src/ && /home/dan/Qt/6.2.3/gcc_64/bin/qmake -o Makefile /home/dan/Documents/qmqtt/src/src.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug cd src/ && /usr/bin/make -f Makefile qmake_all make[1]: Entering directory '/home/dan/Documents/build-qmqtt-Desktop_Qt_6_2_3_GCC_64bit-Debug/src' cd mqtt/ && /home/dan/Qt/6.2.3/gcc_64/bin/qmake -o Makefile.qmqtt /home/dan/Documents/qmqtt/src/mqtt/qmqtt.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug Project MESSAGE: perl -w /home/dan/Qt/6.2.3/gcc_64/libexec/syncqt.pl -module QtQmqtt -version 1.0.0 -outdir /home/dan/Documents/build-qmqtt-Desktop_Qt_6_2_3_GCC_64bit-Debug -builddir /home/dan/Documents/build-qmqtt-Desktop_Qt_6_2_3_GCC_64bit-Debug /home/dan/Documents/qmqtt