QTypeInfo error on GCC
-
@JonB I get the errors in qtypeinfo.h
/gcc_64/include/QtCore/qtypeinfo.h:265: error: specialization of ‘template<class T> class QTypeInfo’ in different namespace [-fpermissive] class QTypeInfo<TYPE > \ ^~~~~~~~~~~~~~~~ /gcc_64/include/QtCore/qtypeinfo.h:265: error: explicit specialization of ‘template<class T> class QTypeInfo’ outside its namespace must use a nested-name-specifier [-fpermissive] class QTypeInfo<TYPE > \ ^~~~~~~~~~~~~~~~
and in type_traits
/usr/include/c++/8/type_traits:661: error: invalid use of incomplete type ‘class QPoint’ struct is_trivial ^~~~~~~~~~
I don't get any errors in my code.
@Christian-Ehrlicher I did not compile the source code, this is 5.14.2 installed through the installer.
-
@JonB I get the errors in qtypeinfo.h
/gcc_64/include/QtCore/qtypeinfo.h:265: error: specialization of ‘template<class T> class QTypeInfo’ in different namespace [-fpermissive] class QTypeInfo<TYPE > \ ^~~~~~~~~~~~~~~~ /gcc_64/include/QtCore/qtypeinfo.h:265: error: explicit specialization of ‘template<class T> class QTypeInfo’ outside its namespace must use a nested-name-specifier [-fpermissive] class QTypeInfo<TYPE > \ ^~~~~~~~~~~~~~~~
and in type_traits
/usr/include/c++/8/type_traits:661: error: invalid use of incomplete type ‘class QPoint’ struct is_trivial ^~~~~~~~~~
I don't get any errors in my code.
@Christian-Ehrlicher I did not compile the source code, this is 5.14.2 installed through the installer.
@Xumepoc said in QTypeInfo error on GCC:
@Christian-Ehrlicher I did not compile the source code, this is 5.14.2 installed through the installer.
I never said this.
You're trying to compile some code. This code triggers a warning inside the Qt headers. So simplify your code until the error is no longer triggered and the fix your code.
-
Yes, that would be a solution, if the project was started in Linux and complied with GCC. But as I said in my previous post, this project was originally written in Windows and compiled with MSVS where that error does not occurs. So I am not sure at what step during the development phase of the project the effect would appear if it was compiled with GCC in the first place.
-
Hi,
In that case, keep only a bare main.cpp file and gradually add back your other files until it breaks.
-
Have you not considered using a newer version of GCC? I'm not sure on the specifics on the changes between 8 and 11 (for example), but it would be worth a shot, considering I have never had an issue in Qt triggered by a fault in GCC (which is the compiler I have Qt set to use).
sudo yum groupinstall "Development Tools"
? -
Yes, that would be a solution, if the project was started in Linux and complied with GCC. But as I said in my previous post, this project was originally written in Windows and compiled with MSVS where that error does not occurs. So I am not sure at what step during the development phase of the project the effect would appear if it was compiled with GCC in the first place.
@Xumepoc Again: you compile a your source files on linux. So look which source file generates the error and strip it down until it no longer occurs - daily programmers business.
-
@Christian-Ehrlicher I didn't expect anyone to debug my code, just if someone had encountered the same issues or have some guidance.
-
@Christian-Ehrlicher I didn't expect anyone to debug my code, just if someone had encountered the same issues or have some guidance.
@Xumepoc said in QTypeInfo error on GCC:
or have some guidance.
We have (and told you already a lot of times) - take a look from where the error comes from and fix it.
-
@Christian-Ehrlicher I didn't expect anyone to debug my code, just if someone had encountered the same issues or have some guidance.
@Xumepoc
I did ask you earlier where from your own code does the#include
which leads to this error appear, but never got an answer.Never mind. I believe/suggest you might find your situation is reported on this forum in Q_DECLARE_TYPEINFO and namespaces - how does it work? from 2012? I suggest you read there. The final post indicates to me there is a change which will allow your code to compile under GCC as well as MSVC:
Case 2: I did forget the semicolon after the Q_DECLARE_TYPEINFO. This case now works on both compilers. Thanks!