QArchive icon indicating copy to clipboard operation
QArchive copied to clipboard

Qt6 build error

Open d-divita opened this issue 3 years ago • 4 comments

Select your issue type: (check at least one)

  • [ ] Bug
  • [ ] Question
  • [ ] Suggestion
  • [X] Other (please describe):

Describe your issue: I'm trying to build the examples with Qt 6.2.2 on Windows with MinGW and I get several errors (and some warnings), here they are:

[Warning]

....\src\qarchivecompressor_p.cc:421:46: warning: 'T* QScopedPointer<T, Cleanup>::take() [with T = QBuffer; Cleanup = QScopedPointerDeleter<QBuffer>]' is deprecated: Use std::unique_ptr instead, and call release(). [-Wdeprecated-declarations] 421 | emit memoryFinished(m_Buffer.take());

which is present also in qarchivecompressor_p.cc:451, qarchiveextractor_p.cc:424, and qarchiveextractor_p.cc:475

[Errors] (the actual errors are very long, if needed I can paste them entirely)

release\moc_qarchivecompressor_p.cpp:281:1: required from here C:/Qt/Tools/mingw900_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/type_traits:1372:38: error: invalid use of incomplete type 'class QVariant

release\moc_qarchivecompressor_p.cpp:281:1: required from here C:/Qt/Tools/mingw900_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/type_traits:115:12: error: 'value' is not a member of 'std::is_base_of<QList<QVariant>, QVariant>'

release\moc_qarchivecompressor_p.cpp:281:1: required from here C:/Qt/Tools/mingw900_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/type_traits:177:64: error: 'value' is not a member of 'std::conjunction<std::disjunction<std::is_base_of<QList<QVariant>, QVariant>, QTypeTraits::has_ostream_operator<QDataStream, QVariant, void> > >'

release\moc_qarchivecompressor_p.cpp:281:1: required from here C:/Qt/Tools/mingw900_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/type_traits:115:12: error: 'value' is not a member of 'std::is_base_of<QList<QVariant>, QVariant>'

release\moc_qarchivecompressor_p.cpp:281:1: required from here C:/Qt/Tools/mingw900_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/type_traits:3072:57: error: 'value' is not a member of 'std::is_trivial<QVariant>'

from release\moc_qarchivecompressor_p.cpp:9: C:/Qt/Tools/mingw900_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/type_traits:673:52: error: static assertion failed: template argument must be a complete class or an unbounded array 673 | static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ C:/Qt/Tools/mingw900_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/type_traits:673:52: note: 'std::__is_complete_or_unbounded<std::__type_identity<QVariant> >((std::__type_identity<QVariant>{}, std::__type_identity<QVariant>()))' evaluates to false

release\moc_qarchivecompressor_p.cpp:281:1: required from here C:/Qt/6.2.2/mingw_64/include/QtCore/qtypeinfo.h:69:10: error: enumerator value for 'isComplex' is not an integer constant

and some other similar errors

Do you have any clue on what's going on and a possible solution?

d-divita avatar Jan 19 '22 14:01 d-divita

Seems very hard to debug since this error is from moc. I will try to build this and check where the error is coming from.

antony-jr avatar Jan 19 '22 15:01 antony-jr

Note that this is maybe specific to the compiler version too. I don't reproduce the errors with gcc 10.3.0 on linux, only the deprecation warnings.

DeuxVis avatar Jan 24 '22 15:01 DeuxVis

@d-divita how was Qt 6.2.2 installed in your environment ? I am asking because that incomplete type 'class QVariant error : I often get similar errors when I build my own Qt and disable some Qt features or modules that I actually need/use.

DeuxVis avatar Jan 24 '22 15:01 DeuxVis

@DeuxVis I'm on Windows, I installed it through the online installer, I selected MinGW 9.0.0 inside Qt 6.2.2, and no other packages. I see that Qt 6.2.1 uses MinGW 8.1.0 and Qt 6.3.0 uses MinGW 11.2.0, I could try also these two to see if there are differences in the build errors.

image

d-divita avatar Jan 24 '22 17:01 d-divita

@antony-jr https://forum.qt.io/topic/84059/invalid-application-of-sizeof-to-incomplete-type-qvariant/3 says missing header. I applied the suggestion locally to qarchivecompressor_p.h and it worked.

neheb avatar Nov 13 '22 03:11 neheb

@antony-jr https://forum.qt.io/topic/84059/invalid-application-of-sizeof-to-incomplete-type-qvariant/3 says missing header. I applied the suggestion locally to qarchivecompressor_p.h and it worked.

Interesting, but I never used QVariant in the code anywhere.

antony-jr avatar Nov 13 '22 05:11 antony-jr

https://github.com/antony-jr/QArchive/blob/master/include/qarchivecompressor_p.hpp#L27

neheb avatar Nov 13 '22 06:11 neheb

https://github.com/antony-jr/QArchive/blob/master/include/qarchivecompressor_p.hpp#L27

Thanks. Definitely missed that, I will merge the PR asap.

antony-jr avatar Nov 13 '22 08:11 antony-jr