redefinition of 'struct QMetaTypeId2<int> in moc_mainwindow.cpp
-
I have a complex Qt program with many subclasses referenced as class variables in the qMainWindow. It started with early versions of Qt 5.
Unfortunately, after about Qt 5.5 or 5.6, qOverload gets involved and I have to up the compiler to c++14. (That may not be a real issue, but it is an annoyance when I am trying to build for previous platforms, and yet work on current platforms.)
During this process, I found that you cannot include class headers in your mainwindow.h file, as that causes a "redefinition of 'struct QMetaTypeId2<int>" in qobject.h, qmetatype.h. Apparently, the Qt fencing is not operating well with the later compiler versions. I suspect compiler fencing is mostly broken. Even #pragma once seems to fail.
A solution that worked until moc_mainwindow.cpp is compiled is to not include any header files in mainwindow.h, but only in the CPP files. I can live with that, but it is messy.
The issue I am having now is that the automatically generated moc_mainwindow.cpp includes mainwindow.h header file first. The moc...cpp compile fails. So, if I start including headers using my own fencing inside the mainwinow.h, the rest of the system still compiles, but the moc_mainwindow.cpp file fails to compile due to the redefinition.
I was hoping to eventually spawn other "mainwindows" which is why I want class variables that are classes (and not pointers to classes).
Is there any solution other than a pointer to a class in the mainwindow.h with a forward class definition?
I can make that work, but it will require a lot of rewriting, which I am not really happy to do with a system that easily compiled under previous versions of Qt.
Any suggestions are welcome!
-
for TLDR; 1) 0 is no longer honored by compilers to follow K&R white book rules, and 2) c++11 has problems with qObject, after Qt 5.12 (or maybe 5.5.1). However, c++14 fixes that error.
OK. Thanks to your request, I narrowed it down. 0 is forbidden in modern c compilers as a universally cast item, even though it breaks K&R's statement that 0 is automatically cast to anything. The white book should be canceled now.
#ifndef nullptr #define nullptr 0 #endif
Defining this before
#include <QMainWindow>
in a blank Qt project breaks the entire project with the error (apparently ignoring fences):
/usr/include/x86_64-linux-gnu/qt5/QtCore/qmetatype.h:2277:1: error redefinition of ‘struct QMetaTypeId2<int>’ QT_FOR_EACH_STATIC_TYPE(Q_DECLARE_BUILTIN_METATYPE)
Removing that define fixes that compiler error, introducing another error.
So, commenting out that define causes the following problem, but only for c++11:
/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP/ui_dialogaddtopic.h:55:82: error: ‘qOverload’ was not declared in this scope QObject::connect(buttonBox, &QDialogButtonBox::accepted, DialogAddTopic, qOverload<>(&QDialog::accept)); ^~~~~~~~~ /mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP/ui_dialogaddtopic.h:55:82: note: suggested alternative: ‘QOverload’
changing the compiler to c++14 fixes that problem.
So, either there is a cascade for c++11 compiler tech (your comment notwithstanding) that causes everything to break in Qt 5.12, or the compiler writers have to be notified.
I was stupid in that I tried to fix a (complained about in previous forums) header file problem in a previous version Qt for (now) unsupported versions of Qt, using a nullptr define. The resulting compile was a cascading "something" that using a 0 caused. It acts like fencing broke, but I don't see why. However, it did lead me far away from the original source of the error, because it was working in earlier versions of Qt.
The END RESULT is I have learned to NEVER do Qt includes in my Qt header files. Only do simple includes which never reference any Qt headers. Qt is extremely sensitive to compiler versioning, and that changes between minor dot releases.
Also K&R white book appears to be only a suggestion to compiler writers.My true idiocy was believing K&R still held. Everything is changing too fast for me to keep up. I'm too old and too stupid.
oh, well. problem solved for now.
Thanks! Your insistence helped!
-
I don't have such problems with including Qt headers somewhere - please provide a minimal, compilable example of your issue.
-
hmm. That may be a problem. It is a large system and only started having issues when later versions of Qt required more that c++11. Here is a dump of the compile message output, followed by mainwindow.h and moc_mainwindow.cpp, Multi-core multi-thread compile under Lubuntu.
11:37:03: Running steps for project CWP...
11:37:03: Starting: "/usr/lib/qt5/bin/qmake" /drop-folder/Dropbox/bible/CWP-Desktop-QT/src/CWP/CWP.pro -spec linux-g++ CONFIG+=debug CONFIG-=qml_debug
Project MESSAGE: Linux: QWebKit build
Project MESSAGE: QWebKit build
Project MESSAGE: linuxdeployqt not found
Project MESSAGE: debug: working directory--> /mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP
Project MESSAGE: Linux build
Project MESSAGE: Linux: !GCC 4
Project MESSAGE: Linux: c++17 (for qOverload)
11:37:07: The process "/usr/lib/qt5/bin/qmake" exited normally.
11:37:07: Starting: "/usr/bin/make" -f /home/depth/cwp_build/build-CWP-Desktop_5_12-Debug/Makefile qmake_all
make: Nothing to be done for 'qmake_all'.
11:37:07: The process "/usr/bin/make" exited normally.
11:37:07: Starting: "/usr/bin/make" -j4
g++ -c -pipe -Wno-expansion-to-defined -Wno-old-style-cast -Wno-unused-function -Wno-inconsistent-missing-override -g -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DWEBKIT_USED=1 -DWEBKIT_USED=1 -DCWP_TITLE_STRING='"CWP Bible Study Program"' -DCWP_VERSION_NUMBER='"1.0.9"' -DRELEASE_VERSION=0 -DENABLE_EDIT=1 -DENABLE_SPEECH=0 -DENABLE_MENUS=0 -DFALLTHROUGH_ALLOWED=1 -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP -I. -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/copyrightDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/notesWindow -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/BookMarkDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture/PictureInfoDatabase -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/TimerClass -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/wheelWidget -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/MediaModule -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/BookMarkDB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/BibleDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/AddTopic -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectBookInBible -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/StrongsDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Search -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/EnglishDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/helpLibrary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/userhistory -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/History -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Notes -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectChapterInBook -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectVerse -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/FootNote -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarkviewer -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarklistviewer -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKit -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o moc_mainwindow.o moc_mainwindow.cpp
g++ -c -pipe -Wno-expansion-to-defined -Wno-old-style-cast -Wno-unused-function -Wno-inconsistent-missing-override -g -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DWEBKIT_USED=1 -DWEBKIT_USED=1 -DCWP_TITLE_STRING='"CWP Bible Study Program"' -DCWP_VERSION_NUMBER='"1.0.9"' -DRELEASE_VERSION=0 -DENABLE_EDIT=1 -DENABLE_SPEECH=0 -DENABLE_MENUS=0 -DFALLTHROUGH_ALLOWED=1 -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP -I. -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/copyrightDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/notesWindow -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/BookMarkDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture/PictureInfoDatabase -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/TimerClass -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/wheelWidget -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/MediaModule -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/BookMarkDB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/BibleDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/AddTopic -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectBookInBible -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/StrongsDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Search -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/EnglishDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/helpLibrary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/userhistory -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/History -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Notes -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectChapterInBook -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectVerse -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/FootNote -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarkviewer -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarklistviewer -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKit -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o moc_dialogselectverse.o moc_dialogselectverse.cpp
g++ -c -pipe -Wno-expansion-to-defined -Wno-old-style-cast -Wno-unused-function -Wno-inconsistent-missing-override -g -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DWEBKIT_USED=1 -DWEBKIT_USED=1 -DCWP_TITLE_STRING='"CWP Bible Study Program"' -DCWP_VERSION_NUMBER='"1.0.9"' -DRELEASE_VERSION=0 -DENABLE_EDIT=1 -DENABLE_SPEECH=0 -DENABLE_MENUS=0 -DFALLTHROUGH_ALLOWED=1 -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP -I. -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/copyrightDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/notesWindow -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/BookMarkDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture/PictureInfoDatabase -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/TimerClass -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/wheelWidget -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/MediaModule -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/BookMarkDB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/BibleDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/AddTopic -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectBookInBible -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/StrongsDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Search -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/EnglishDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/helpLibrary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/userhistory -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/History -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Notes -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectChapterInBook -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectVerse -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/FootNote -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarkviewer -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarklistviewer -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKit -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o moc_dialogfootnote.o moc_dialogfootnote.cpp
g++ -c -pipe -Wno-expansion-to-defined -Wno-old-style-cast -Wno-unused-function -Wno-inconsistent-missing-override -g -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DWEBKIT_USED=1 -DWEBKIT_USED=1 -DCWP_TITLE_STRING='"CWP Bible Study Program"' -DCWP_VERSION_NUMBER='"1.0.9"' -DRELEASE_VERSION=0 -DENABLE_EDIT=1 -DENABLE_SPEECH=0 -DENABLE_MENUS=0 -DFALLTHROUGH_ALLOWED=1 -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP -I. -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/copyrightDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/notesWindow -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/BookMarkDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture/PictureInfoDatabase -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/TimerClass -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/wheelWidget -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/MediaModule -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/BookMarkDB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/BibleDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/AddTopic -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectBookInBible -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/StrongsDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Search -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/EnglishDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/helpLibrary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/userhistory -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/History -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Notes -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectChapterInBook -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectVerse -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/FootNote -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarkviewer -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarklistviewer -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKit -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o moc_dialogselectchapterinbook.o moc_dialogselectchapterinbook.cpp
g++ -c -pipe -Wno-expansion-to-defined -Wno-old-style-cast -Wno-unused-function -Wno-inconsistent-missing-override -g -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DWEBKIT_USED=1 -DWEBKIT_USED=1 -DCWP_TITLE_STRING='"CWP Bible Study Program"' -DCWP_VERSION_NUMBER='"1.0.9"' -DRELEASE_VERSION=0 -DENABLE_EDIT=1 -DENABLE_SPEECH=0 -DENABLE_MENUS=0 -DFALLTHROUGH_ALLOWED=1 -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP -I. -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/copyrightDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/notesWindow -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/BookMarkDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture/PictureInfoDatabase -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/TimerClass -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/wheelWidget -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/MediaModule -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/BookMarkDB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/BibleDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/AddTopic -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectBookInBible -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/StrongsDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Search -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/EnglishDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/helpLibrary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/userhistory -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/History -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Notes -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectChapterInBook -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectVerse -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/FootNote -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarkviewer -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarklistviewer -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKit -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o moc_dialoghistory.o moc_dialoghistory.cpp
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:56,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qwidget.h:45,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qmainwindow.h:44,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QMainWindow:1,
from ../../../../mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP/mainwindow.h:17,
from moc_mainwindow.cpp:9:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qmetatype.h:2277:1: error: redefinition of ‘struct QMetaTypeId2<int>’
QT_FOR_EACH_STATIC_TYPE(Q_DECLARE_BUILTIN_METATYPE)
^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/qt5/QtCore/qmetatype.h:2277:1: note: previous definition of ‘struct QMetaTypeId2<int>’
QT_FOR_EACH_STATIC_TYPE(Q_DECLARE_BUILTIN_METATYPE)
^~~~~~~~~~~~~~~~~~~~~~~
g++ -c -pipe -Wno-expansion-to-defined -Wno-old-style-cast -Wno-unused-function -Wno-inconsistent-missing-override -g -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DWEBKIT_USED=1 -DWEBKIT_USED=1 -DCWP_TITLE_STRING='"CWP Bible Study Program"' -DCWP_VERSION_NUMBER='"1.0.9"' -DRELEASE_VERSION=0 -DENABLE_EDIT=1 -DENABLE_SPEECH=0 -DENABLE_MENUS=0 -DFALLTHROUGH_ALLOWED=1 -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP -I. -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/copyrightDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/notesWindow -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/BookMarkDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture/PictureInfoDatabase -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/TimerClass -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/biblepicture -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/wheelWidget -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/MediaModule -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/BookMarkDB -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/BibleDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/AddTopic -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectBookInBible -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/StrongsDialog -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Search -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/EnglishDictionary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/helpLibrary -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/userhistory -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Preferences -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/History -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/shared/Notes -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectChapterInBook -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/SelectVerse -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/FootNote -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarkviewer -I/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/dialogs/bookmarklistviewer -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKit -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o moc_dialogsearch.o moc_dialogsearch.cpp
In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/qregion.h:49,
from /usr/include/x86_64-linux-gnu/qt5/QtGui/qmatrix.h:45,
from /usr/include/x86_64-linux-gnu/qt5/QtGui/qbrush.h:49,
from /usr/include/x86_64-linux-gnu/qt5/QtGui/qpalette.h:46,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qwidget.h:48,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qmainwindow.h:44,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QMainWindow:1,
from ../../../../mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP/mainwindow.h:17,
from moc_mainwindow.cpp:9:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qdatastream.h:158:18: error: ‘QDataStream& QDataStream::operator>>(std::nullptr_t&)’ cannot be overloaded with ‘QDataStream& QDataStream::operator>>(qint32&)’
QDataStream &operator>>(std::nullptr_t &ptr) { ptr = nullptr; return *this; }
^~~~~~~~
/usr/include/x86_64-linux-gnu/qt5/QtCore/qdatastream.h:154:18: note: previous declaration ‘QDataStream& QDataStream::operator>>(qint32&)’
QDataStream &operator>>(qint32 &i);
^~~~~~~~
/usr/include/x86_64-linux-gnu/qt5/QtCore/qdatastream.h:174:18: error: ‘QDataStream& QDataStream::operator<<(std::nullptr_t)’ cannot be overloaded with ‘QDataStream& QDataStream::operator<<(qint32)’
QDataStream &operator<<(std::nullptr_t) { return *this; }
^~~~~~~~
/usr/include/x86_64-linux-gnu/qt5/QtCore/qdatastream.h:170:18: note: previous declaration ‘QDataStream& QDataStream::operator<<(qint32)’
QDataStream &operator<<(qint32 i);
^~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/qabstractsocket.h:47,
from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/qtcpsocket.h:44,
from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/qsslsocket.h:48,
from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/qsslconfiguration.h:62,
from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/QSslConfiguration:1,
from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/qnetworkaccessmanager.h:49,
from /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets/qwebview.h:29,
from /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets/QWebView:1,
from ../../../../mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP/mainwindow.h:38,
from moc_mainwindow.cpp:9:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qdebug.h:163:20: error: ‘QDebug& QDebug::operator<<(std::nullptr_t)’ cannot be overloaded with ‘QDebug& QDebug::operator<<(int)’
inline QDebug &operator<<(std::nullptr_t) { stream->ts << "(nullptr)"; return maybeSpace(); }
^~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/qabstractsocket.h:47,
from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/qtcpsocket.h:44,
from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/qsslsocket.h:48,
from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/qsslconfiguration.h:62,
from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/QSslConfiguration:1,
from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/qnetworkaccessmanager.h:49,
from /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets/qwebview.h:29,
from /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets/QWebView:1,
from ../../../../mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP/mainwindow.h:38,
from moc_mainwindow.cpp:9:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qdebug.h:145:20: note: previous declaration ‘QDebug& QDebug::operator<<(int)’
inline QDebug &operator<<(signed int t) { stream->ts << t; return maybeSpace(); }
^~~~~~~~
cc1plus: warning: unrecognized command line option ‘-Wno-inconsistent-missing-override’
make: *** [Makefile:2176: moc_mainwindow.o] Error 1
make: *** Waiting for unfinished jobs....
11:37:13: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project CWP (kit: Desktop 5.12)
When executing step "Make" -
#ifndef MAINWINDOW_H
#define MAINWINDOW_H#pragma once
#pragma GCC diagnostic ignored "-Wold-style-cast"
#ifdef Q_OS_WIN
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#pragma GCC diagnostic ignored "-Wunused-function"#ifndef nullptr
#define nullptr 0
#endif#ifndef QDYNAMICMAINWINDOW_H
#include <QMainWindow>
#endif#ifndef MAX_POSSIBLE_VERSE_NUM
#include "biblemaxvalues.h"
#endif#ifndef BOOL
#include "cwpdefines.h"
#endif#ifndef QTIMER_H
#include <QTimer>
#endif#ifndef QNETWORKREQUEST_H
#include <QNetworkRequest>
#endif#ifndef QWEBVIEW_H
#include <QWebView>
#endifclass ActivityIndicatorClass;
class QTimer;/*
#include <QUrl>
#include "cwpdefines.h"
#ifdef WEBENGINE_USED
#include <QtWebEngineWidgets/QtWebEngineWidgets>
#endif
#include "biblemaxvalues.h"
*/
#define DONT_WRITE_LOCATION_TO_DISK NO
#define WRITE_LOCATION_TO_DISK YESnamespace Ui {
class MainWindow;
}class MainWindow : public QMainWindow
{
Q_OBJECTpublic:
QString urlString;#ifdef WEBKIT_USED
QWebView *webView;
#endif
#ifdef WEBENGINE_USED
QWebEngineView *webView;
#endifexplicit MainWindow(QWidget *parent = 0); ~MainWindow(); void resizeEvent ( QResizeEvent * event ); bool event(QEvent *e);
// bool eventFilter(QObject *obj, QEvent *event);
//void focusInEvent(QFocusEvent *e);
void showEnglishDictionary();
void showMorphology(QString MorphologyText);void showStrongsWithNumber(QString StrongsNumber, /*Language:*/QString L,/* Word:*/QString word); void showBookMarkAdd(QString bookNumber,/* Chapter:*/ QString lchapter ,/*Verse:*/ QString lverse); void showVerseEditForIndex(int indexIntoSelectedBooksArray,/* Book:*/ QString bookNumber ,/*Chapter:*/ QString lchapter,/* Verse:*/ QString lverse); void showFootNoteForBible( QString BibleNumber, /* Book:*/ QString Number , /*Chapter:*/ QString Chapter , /*Verse:*/ QString Verse , /*SeqNumber:*/ QString SeqNumber); void showCopyrightForBookNumber( QString BibleNumber, /* ofType:*/ QString Type); void showNotesWindowForNoteIndex(int noteIndex ,/* Book*/ int lnumber ,/*Chapter*/ int lchapter,/* Verse*/ int lverse); void showCopyDialog(QString Number,QString Chapter,QString Verse,QString BibleNumber,QString BibleName); void saveCurrentLocation(BOOL WriteToPrefs); void startWaitIndicator(); //-------------------------------------------- // the following are asynchronous!! //-------------------------------------------- QString elementPageOffset;
#ifdef WEBKIT_USED
// QString getElementPageOffset(QString element);
void updateVerseYOffsets();
#endif
int getVerseYOffset(int16_t verseNumber);
#ifdef WEBENGINE_USED
void updateVerseYOffsets();
int getVerseXOffset(int16_t verseNumber);
// void getElementPageOffset(QString element);
bool doSetCurrentVerseByScrollPosition;
int16_t updateVerseNumber; // used for asynchronous update of verse locations
#endif
int currentScrollPosition;bool elementPageOffsetDone; //-------------------------------------------- //-------------------------------------------- int mainwindowWidth; // last measured width int mainwindowHeight;// last measured height int getPageScrollPosition();// get the webkit/webengine offset void setCurrentVerseByScrollPosition();
#ifdef WEBENGINE_USED
void scrollPositionArrived(int scrollPosition);
void updateNextVerseYOffset();
#endif
ActivityIndicatorClass *activityIndicator;int verseYOffsets[MAX_POSSIBLE_VERSE_NUM]; // actually, 150 should do it. the extra is for padding QString imagePath; // path where images are located void createRecentSearchesPopOver(); QTimer *miscTimer; QTimer initTimer; QTimer webTimer; void LoadWebPage(); int refreshWebPage; int refreshVerses; int scrollToCurrentVerse(); bool doScrollToVerseAfterWebPageLoad; int16_t verseToScrollToAfterWebPageLoad; int book; int chapter; int verse; QString bookNameLabel;// may replace later with UILabel QString bookMarkTopic; int calculatePositionOfVerse(int VerseNumber); int16_t getVerseFromScrollPosition(); int scrollToVerse(int16_t verse);
public slots:
void on_actionBible_Dictionary_triggered();private slots:
void Init();
void timerCheck();void on_actionSelect_Bibles_triggered(); void on_actionExit_triggered(); //-------------------------------------- //webview slots start void link_click(const QUrl &); void on_pushButton_clicked(); void webPageFinishedLoading(bool b); void processLink(); void webPageLoadStarted(); void webPageURLChanged(const QUrl &url);
#ifdef WEBKIT_USED
void myDownloadRequested(QNetworkRequest r) ;
#endif
// webview slots finished
//--------------------------------------void handleElementID(QString element); void on_actionBookMark_triggered(); //void on_actionTopic_triggered(); void on_actionLeft_triggered(); void on_actionRight_triggered(); void on_actionBibleBooks_triggered(); void on_actionBooksInBible_triggered(); void on_actionPreferences_triggered(); void on_actionHistory_triggered(); void on_actionSearch_2_triggered(); void on_actionTagalog_triggered(); void on_actionAbout_triggered(); void on_actionCreate_translation_template_triggered(); void on_actionShow_Help_triggered();
private:
Ui::MainWindow *ui;QString lastElementID; bool doShowEditVerse; int16_t dismissCounter; bool doShowHelp;
};
extern MainWindow *fvcp;
extern MainWindow *currentFVC;#ifndef TRUE
#define TRUE 1
#endif
#endif // MAINWINDOW_H -
/****************************************************************************
** Meta object code from reading C++ file 'mainwindow.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.2)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/#include "../../../../mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP/mainwindow.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'mainwindow.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.12.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endifQT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_MainWindow_t {
QByteArrayData data[32];
char stringdata0[647];
};
#define QT_MOC_LITERAL(idx, ofs, len)
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len,
qptrdiff(offsetof(qt_meta_stringdata_MainWindow_t, stringdata0) + ofs
- idx * sizeof(QByteArrayData))
)
static const qt_meta_stringdata_MainWindow_t qt_meta_stringdata_MainWindow = {
{
QT_MOC_LITERAL(0, 0, 10), // "MainWindow"
QT_MOC_LITERAL(1, 11, 35), // "on_actionBible_Dictionary_tri..."
QT_MOC_LITERAL(2, 47, 0), // ""
QT_MOC_LITERAL(3, 48, 4), // "Init"
QT_MOC_LITERAL(4, 53, 10), // "timerCheck"
QT_MOC_LITERAL(5, 64, 32), // "on_actionSelect_Bibles_triggered"
QT_MOC_LITERAL(6, 97, 23), // "on_actionExit_triggered"
QT_MOC_LITERAL(7, 121, 10), // "link_click"
QT_MOC_LITERAL(8, 132, 21), // "on_pushButton_clicked"
QT_MOC_LITERAL(9, 154, 22), // "webPageFinishedLoading"
QT_MOC_LITERAL(10, 177, 1), // "b"
QT_MOC_LITERAL(11, 179, 11), // "processLink"
QT_MOC_LITERAL(12, 191, 18), // "webPageLoadStarted"
QT_MOC_LITERAL(13, 210, 17), // "webPageURLChanged"
QT_MOC_LITERAL(14, 228, 3), // "url"
QT_MOC_LITERAL(15, 232, 19), // "myDownloadRequested"
QT_MOC_LITERAL(16, 252, 15), // "QNetworkRequest"
QT_MOC_LITERAL(17, 268, 1), // "r"
QT_MOC_LITERAL(18, 270, 15), // "handleElementID"
QT_MOC_LITERAL(19, 286, 7), // "element"
QT_MOC_LITERAL(20, 294, 27), // "on_actionBookMark_triggered"
QT_MOC_LITERAL(21, 322, 23), // "on_actionLeft_triggered"
QT_MOC_LITERAL(22, 346, 24), // "on_actionRight_triggered"
QT_MOC_LITERAL(23, 371, 29), // "on_actionBibleBooks_triggered"
QT_MOC_LITERAL(24, 401, 31), // "on_actionBooksInBible_triggered"
QT_MOC_LITERAL(25, 433, 30), // "on_actionPreferences_triggered"
QT_MOC_LITERAL(26, 464, 26), // "on_actionHistory_triggered"
QT_MOC_LITERAL(27, 491, 27), // "on_actionSearch_2_triggered"
QT_MOC_LITERAL(28, 519, 26), // "on_actionTagalog_triggered"
QT_MOC_LITERAL(29, 546, 24), // "on_actionAbout_triggered"
QT_MOC_LITERAL(30, 571, 46), // "on_actionCreate_translation_t..."
QT_MOC_LITERAL(31, 618, 28) // "on_actionShow_Help_triggered"}, "MainWindow\0on_actionBible_Dictionary_triggered\0" "\0Init\0timerCheck\0on_actionSelect_Bibles_triggered\0" "on_actionExit_triggered\0link_click\0" "on_pushButton_clicked\0webPageFinishedLoading\0" "b\0processLink\0webPageLoadStarted\0" "webPageURLChanged\0url\0myDownloadRequested\0" "QNetworkRequest\0r\0handleElementID\0" "element\0on_actionBookMark_triggered\0" "on_actionLeft_triggered\0" "on_actionRight_triggered\0" "on_actionBibleBooks_triggered\0" "on_actionBooksInBible_triggered\0" "on_actionPreferences_triggered\0" "on_actionHistory_triggered\0" "on_actionSearch_2_triggered\0" "on_actionTagalog_triggered\0" "on_actionAbout_triggered\0" "on_actionCreate_translation_template_triggered\0" "on_actionShow_Help_triggered"
};
#undef QT_MOC_LITERALstatic const uint qt_meta_data_MainWindow[] = {
// content:
8, // revision
0, // classname
0, 0, // classinfo
25, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount// slots: name, argc, parameters, tag, flags
1, 0, 139, 2, 0x0a /* Public /,
3, 0, 140, 2, 0x08 / Private /,
4, 0, 141, 2, 0x08 / Private /,
5, 0, 142, 2, 0x08 / Private /,
6, 0, 143, 2, 0x08 / Private /,
7, 1, 144, 2, 0x08 / Private /,
8, 0, 147, 2, 0x08 / Private /,
9, 1, 148, 2, 0x08 / Private /,
11, 0, 151, 2, 0x08 / Private /,
12, 0, 152, 2, 0x08 / Private /,
13, 1, 153, 2, 0x08 / Private /,
15, 1, 156, 2, 0x08 / Private /,
18, 1, 159, 2, 0x08 / Private /,
20, 0, 162, 2, 0x08 / Private /,
21, 0, 163, 2, 0x08 / Private /,
22, 0, 164, 2, 0x08 / Private /,
23, 0, 165, 2, 0x08 / Private /,
24, 0, 166, 2, 0x08 / Private /,
25, 0, 167, 2, 0x08 / Private /,
26, 0, 168, 2, 0x08 / Private /,
27, 0, 169, 2, 0x08 / Private /,
28, 0, 170, 2, 0x08 / Private /,
29, 0, 171, 2, 0x08 / Private /,
30, 0, 172, 2, 0x08 / Private /,
31, 0, 173, 2, 0x08 / Private */,// slots: parameters
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void, QMetaType::QUrl, 2,
QMetaType::Void,
QMetaType::Void, QMetaType::Bool, 10,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void, QMetaType::QUrl, 14,
QMetaType::Void, 0x80000000 | 16, 17,
QMetaType::Void, QMetaType::QString, 19,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,0 // eod
};
void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
auto *_t = static_cast<MainWindow *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->on_actionBible_Dictionary_triggered(); break;
case 1: _t->Init(); break;
case 2: _t->timerCheck(); break;
case 3: _t->on_actionSelect_Bibles_triggered(); break;
case 4: _t->on_actionExit_triggered(); break;
case 5: _t->link_click((reinterpret_cast< const QUrl()>(_a[1]))); break;
case 6: _t->on_pushButton_clicked(); break;
case 7: _t->webPageFinishedLoading((reinterpret_cast< bool()>(_a[1]))); break;
case 8: _t->processLink(); break;
case 9: _t->webPageLoadStarted(); break;
case 10: _t->webPageURLChanged((reinterpret_cast< const QUrl()>(_a[1]))); break;
case 11: _t->myDownloadRequested((reinterpret_cast< QNetworkRequest()>(_a[1]))); break;
case 12: _t->handleElementID((reinterpret_cast< QString()>(_a[1]))); break;
case 13: _t->on_actionBookMark_triggered(); break;
case 14: _t->on_actionLeft_triggered(); break;
case 15: _t->on_actionRight_triggered(); break;
case 16: _t->on_actionBibleBooks_triggered(); break;
case 17: _t->on_actionBooksInBible_triggered(); break;
case 18: _t->on_actionPreferences_triggered(); break;
case 19: _t->on_actionHistory_triggered(); break;
case 20: _t->on_actionSearch_2_triggered(); break;
case 21: _t->on_actionTagalog_triggered(); break;
case 22: _t->on_actionAbout_triggered(); break;
case 23: _t->on_actionCreate_translation_template_triggered(); break;
case 24: _t->on_actionShow_Help_triggered(); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: reinterpret_cast<int>(_a[0]) = -1; break;
case 11:
switch (reinterpret_cast<int>(_a[1])) {
default: reinterpret_cast<int>(_a[0]) = -1; break;
case 0:
reinterpret_cast<int>(_a[0]) = qRegisterMetaType< QNetworkRequest >(); break;
}
break;
}
}
}QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = { {
&QMainWindow::staticMetaObject,
qt_meta_stringdata_MainWindow.data,
qt_meta_data_MainWindow,
qt_static_metacall,
nullptr,
nullptr
} };const QMetaObject *MainWindow::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}void *MainWindow::qt_metacast(const char _clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_MainWindow.stringdata0))
return static_cast<void>(this);
return QMainWindow::qt_metacast(_clname);
}int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 25)
qt_static_metacall(this, _c, _id, _a);
_id -= 25;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 25)
qt_static_metacall(this, _c, _id, _a);
_id -= 25;
}
return _id;
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE -
Here is the C compiler version:
g++ --version
g++ (Ubuntu 8.3.0-6ubuntu1) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -
This is not a simple, compilable example... please strip it down to a bare minimum and also format your code with the code - tag.
-
@wsma said in redefinition of 'struct QMetaTypeId2<int> in moc_mainwindow.cpp:
Unfortunately, after about Qt 5.5 or 5.6, qOverload gets involved and I have to up the compiler to c++14.
You didn't have to. You can use
QOverload<T...>::of()
with C++11.Here is a dump of the compile message output, followed by mainwindow.h and moc_mainwindow.cpp
That doesn't help us to reproduce the problem, unfortunately.
As @Christian-Ehrlicher said, a minimal, compilable example is your best bet at getting a solution.
-
for TLDR; 1) 0 is no longer honored by compilers to follow K&R white book rules, and 2) c++11 has problems with qObject, after Qt 5.12 (or maybe 5.5.1). However, c++14 fixes that error.
OK. Thanks to your request, I narrowed it down. 0 is forbidden in modern c compilers as a universally cast item, even though it breaks K&R's statement that 0 is automatically cast to anything. The white book should be canceled now.
#ifndef nullptr #define nullptr 0 #endif
Defining this before
#include <QMainWindow>
in a blank Qt project breaks the entire project with the error (apparently ignoring fences):
/usr/include/x86_64-linux-gnu/qt5/QtCore/qmetatype.h:2277:1: error redefinition of ‘struct QMetaTypeId2<int>’ QT_FOR_EACH_STATIC_TYPE(Q_DECLARE_BUILTIN_METATYPE)
Removing that define fixes that compiler error, introducing another error.
So, commenting out that define causes the following problem, but only for c++11:
/mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP/ui_dialogaddtopic.h:55:82: error: ‘qOverload’ was not declared in this scope QObject::connect(buttonBox, &QDialogButtonBox::accepted, DialogAddTopic, qOverload<>(&QDialog::accept)); ^~~~~~~~~ /mnt/hgfs/Dropbox/bible/CWP-Desktop-QT/src/CWP/ui_dialogaddtopic.h:55:82: note: suggested alternative: ‘QOverload’
changing the compiler to c++14 fixes that problem.
So, either there is a cascade for c++11 compiler tech (your comment notwithstanding) that causes everything to break in Qt 5.12, or the compiler writers have to be notified.
I was stupid in that I tried to fix a (complained about in previous forums) header file problem in a previous version Qt for (now) unsupported versions of Qt, using a nullptr define. The resulting compile was a cascading "something" that using a 0 caused. It acts like fencing broke, but I don't see why. However, it did lead me far away from the original source of the error, because it was working in earlier versions of Qt.
The END RESULT is I have learned to NEVER do Qt includes in my Qt header files. Only do simple includes which never reference any Qt headers. Qt is extremely sensitive to compiler versioning, and that changes between minor dot releases.
Also K&R white book appears to be only a suggestion to compiler writers.My true idiocy was believing K&R still held. Everything is changing too fast for me to keep up. I'm too old and too stupid.
oh, well. problem solved for now.
Thanks! Your insistence helped!
-
@JonB I agree. However, 0 as universally cast has held until very recently. This is the first time that 0 has failed me. Also, the "redefinition" error should not have occurred, since it was the exact same file that was flagged as redefining it. It was already fenced. So, either fencing broke, or that is one unusual macro that the compiler just did not handle right.
For instance, certain versions of the gcc compiler do have a problem with calling const void functions from an array. It appears to be a hard coded patch rather than a specifically crafted warning. To silence it, I had to do the following: (a pragma for silencing that specific warning did not work, nor did a specific -Wno-... work from the command line.)
//============================================================= // silence warning about calling const void function. // (gcc has a hardcoded patch // for the const void function that only responds to shutting // down all warnings) //=============================================================
#pragma GCC diagnostic push #pragma GCC diagnostic warning "-w"
return (PRead[PinID])();
//============================================================ #pragma GCC diagnostic pop //============================================================
I realize that the function is void. I realize I am breaking rules (this is embedded) The warning was for *calling* the const void function. Not a warning about using a return from it (which in theory does not exist). I was expecting the warning on using a return from a const void function. BTW, it does work. The compiler template calls for the return to be in the accumulator, and the accumulator is passed forward. Bad coding, yes. Compiler warning is interesting, though. So, compiler writers have hiccuped in the past, and are probably doing it again.....
-
@wsma
Did you at least test compiling(PRead[PinID])()
on its own, to be sure? Without removing thereturn
I would expect any compiler to error, including C ones.Plus ca change. Takes me back to a bug I remember still from System V.0(!!) C compiler. It had support for
void
(just, and I don't recall K&R1 even having that), but I had a big array of(void)()
functions and it barfed on having an array of them. Sound familiar? ;-) Had to#define voidfunc int
and go through all the functions changing them tovoidfunc foo()
and make themreturn
someint
, so they "looked"void
to me but had to returnint
to have the function put into an array! -
@wsma said in redefinition of 'struct QMetaTypeId2<int> in moc_mainwindow.cpp:
Qt is extremely sensitive to compiler versioning, and that changes between minor dot releases.
Not true. Qt 5.7.0 made C++11 compulsory; Qt 6.0.0 made C++17 compulsory. No C++ version bumps were required for any other Qt version.
nullptr
being undefined means that you have not enabled C++11 in your project/compiler. Therefore, the appropriate fix was to simply enable C++11.Please remove all #define's that "clash" with C++11.