Compile #error Add the datastream version for...
Unsolved
Qt 6
-
I've got output on empty project
cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -O2 -MD -std:c++latest -utf-8 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_DISABLE_DEPRECATED_BEFORE=0x060000 -DMAJOR_NUMBER -D= -D0 -DMINOR_NUMBER -D= -D0 -DBUILD_NUMBER -D= -D257 -DNDEBUG -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -IC:\Qt\6.0.0\msvc2019_64\include -IC:\Qt\6.0.0\msvc2019_64\include\QtWidgets -IC:\Qt\6.0.0\msvc2019_64\include\QtGui -IC:\Qt\6.0.0\msvc2019_64\include\QtCore -I..\..\tmp\release\win32\ru.tkaspb.MONITOR.x86_64\moc -IC:\Qt\6.0.0\msvc2019_64\mkspecs\win32-msvc -Fo..\..\tmp\release\win32\ru.tkaspb.MONITOR.x86_64\obj\ @C:\Users\MRBFE9~1.STA\AppData\Local\Temp\mainwindow.obj.15176.782.jom mainwindow.cpp C:\Qt\6.0.0\msvc2019_64\include\QtCore/qdatastream.h(103): fatal error C1189: #error: Add the datastream version for this Qt version and update Qt_DefaultCompiledVersion jom: D:\AFINA\src\MONITOR\Makefile [..\..\tmp\release\win32\ru.tkaspb.MONITOR.x86_64\obj\mainwindow.obj] Error 2
then tested with qmake message($$QT_VERSION) got 6.0.0
thantemplate<int A> class Check { public: static_assert (QT_VERSION < 0x060100, "fff"); static constexpr bool value = A >= 0x060100; }; constexpr bool c = Check<QT_VERSION>::value;
got
cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -O2 -MD -std:c++latest -utf-8 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_DISABLE_DEPRECATED_BEFORE=0x060000 -DMAJOR_NUMBER -D= -D0 -DMINOR_NUMBER -D= -D0 -DBUILD_NUMBER -D= -D258 -DNDEBUG -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -IC:\Qt\6.0.0\msvc2019_64\include -IC:\Qt\6.0.0\msvc2019_64\include\QtWidgets -IC:\Qt\6.0.0\msvc2019_64\include\QtGui -IC:\Qt\6.0.0\msvc2019_64\include\QtCore -I..\..\tmp\release\win32\ru.tkaspb.MONITOR.x86_64\moc -IC:\Qt\6.0.0\msvc2019_64\mkspecs\win32-msvc -Fo..\..\tmp\release\win32\ru.tkaspb.MONITOR.x86_64\obj\ @C:\Users\MRBFE9~1.STA\AppData\Local\Temp\mainwindow.obj.12252.219.jom mainwindow.cpp C:\Qt\6.0.0\msvc2019_64\include\QtCore/qdatastream.h(61): error C2338: fff C:\Qt\6.0.0\msvc2019_64\include\QtCore/qdatastream.h(64): note: see reference to class template instantiation 'Check<393473>' being compiled C:\Qt\6.0.0\msvc2019_64\include\QtCore/qdatastream.h(112): fatal error C1189: #error: Add the datastream version for this Qt version and update Qt_DefaultCompiledVersion
393473 is 0x060101 .... 0.o
then
template<int a, int b,int c> class Check { public: static_assert (QT_VERSION_MAJOR == 0x06, "sss"); static_assert (QT_VERSION_MINOR == 0x00, "ddd"); static_assert (QT_VERSION_PATCH == 0x00, "aaa"); static_assert (QT_VERSION < 0x060100, "fff"); static constexpr bool value = a >= 0x060100; }; constexpr bool c = Check<QT_VERSION_MAJOR, QT_VERSION_MINOR, QT_VERSION_PATCH>::value;
got
C:\Qt\6.0.0\msvc2019_64\include\QtCore/qdatastream.h(63): error C2338: fff C:\Qt\6.0.0\msvc2019_64\include\QtCore/qdatastream.h(66): note: see reference to class template instantiation 'Check<a,b,c>' being compiled C:\Qt\6.0.0\msvc2019_64\include\QtCore/qdatastream.h(114): fatal error C1189: #error: Add the datastream version for this Qt version and update Qt_DefaultCompiledVersion jom: D:\AFINA\src\MONITOR\Makefile [..\..\tmp\release\win32\ru.tkaspb.MONITOR.x86_64\obj\mainwindow.obj] Error 2 jom: D:\AFINA\Makefile [MONITOR-make_first-ordered] Error 2
math is making magic?
'Check<a,b,c>' this way is not showing nombers any more at all...
what is wrong?