type_traitsFile not found
-
I'm running Mint Linux and qt 6 with qtcretaor 6.0. Every time I try to build project it throws error type_traits file not found in qglobal.h.
I've tried setting v5 and v6 and all sorts of kits and compilers but, nothing works.
there are multiple instances of qglobal. Each in a different directory. I do not know which one to fix. Some of the files are named qt20type_traits. Is this the new naming convention?
I'll upload the project if somebody would help me get it built.
Regards,
Marty -
I'm running Mint Linux and qt 6 with qtcretaor 6.0. Every time I try to build project it throws error type_traits file not found in qglobal.h.
I've tried setting v5 and v6 and all sorts of kits and compilers but, nothing works.
there are multiple instances of qglobal. Each in a different directory. I do not know which one to fix. Some of the files are named qt20type_traits. Is this the new naming convention?
I'll upload the project if somebody would help me get it built.
Regards,
MartyYou need a compiler which supports gcc17 which it seems you don't have. You will need at least gcc 9, better gcc10: https://doc.qt.io/qt-6/supported-platforms.html#desktop-platforms
-
Hi,
Which exact version of Qt are you using exactly ?
-
@ham13 said in type_traitsFile not found:
QT6
This is not the exact version. Also you did not answer which compiler you are using.
-
I'm running Mint Linux and qt 6 with qtcretaor 6.0. Every time I try to build project it throws error type_traits file not found in qglobal.h.
I've tried setting v5 and v6 and all sorts of kits and compilers but, nothing works.
there are multiple instances of qglobal. Each in a different directory. I do not know which one to fix. Some of the files are named qt20type_traits. Is this the new naming convention?
I'll upload the project if somebody would help me get it built.
Regards,
Marty@ham13 said in type_traitsFile not found:
I've tried setting v5 and v6 and all sorts of kits and compilers
Which compilers?
The default GCC version in LM 21.x is GCC 11.2.
I think the default GCC version in LM 20.x is GCC 9.4.
Are you using an older Linux Mint? -
I'm using Mint 21.2 Cinnamon which I belive is the latest version.
Using version QT 6.6.1 (gcc_64).
C Compiler - gcc(C, x86, 64 bit in /usr/bin)
C++ Compiler - CLANG 11(C++ , x86 64 bit in /usr/bin)Build settings indicate correct directory for QT6.6.1 and the compiler is CLANG(C++, x86 64 bit in /usr/bin)
QMAKE /home/XXX/qt/6.6.1/gcc_64/bin/qmake
QtGrreator 6.0.2 built on 5.15.3
I believe all gcc compilers above v8 support c-17.
No matter which compiler I use it produces the same error. If I'm using the wrong compiler tell me which to use. The highest I have is V15. Hope the info above helps.If there is a way to upload the project, I'm willing to do that and let you guys try to build it.
Thanks,
Marty -
I'm using Mint 21.2 Cinnamon which I belive is the latest version.
Using version QT 6.6.1 (gcc_64).
C Compiler - gcc(C, x86, 64 bit in /usr/bin)
C++ Compiler - CLANG 11(C++ , x86 64 bit in /usr/bin)Build settings indicate correct directory for QT6.6.1 and the compiler is CLANG(C++, x86 64 bit in /usr/bin)
QMAKE /home/XXX/qt/6.6.1/gcc_64/bin/qmake
QtGrreator 6.0.2 built on 5.15.3
I believe all gcc compilers above v8 support c-17.
No matter which compiler I use it produces the same error. If I'm using the wrong compiler tell me which to use. The highest I have is V15. Hope the info above helps.If there is a way to upload the project, I'm willing to do that and let you guys try to build it.
Thanks,
Marty@ham13 said in type_traitsFile not found:
C Compiler - gcc(C, x86, 64 bit in /usr/bin)
C++ Compiler - CLANG 11(C++ , x86 64 bit in /usr/bin)I believe all gcc compilers above v8 support c-17.
That is C++17. I appears you are not using the GCC C++ compiler.
From the CLang LLVM docs:By default, Clang 16 or later builds C++ code according to the C++17 standard. You can use Clang in C++17 mode with the -std=c++17 option (use -std=c++1z in Clang 4 and earlier).
So, when you build your project, exactly how is the compiler invoked?
Do you have the GCC C++ to try? What version is that GCC compiler?
/usr/bin/g++ --version
Does the referenced file even exist on your machine?
$ locate type_traits.h /usr/include/c++/11/bits/cpp_type_traits.h /usr/include/c++/11/ext/type_traits.h
-
/usr/bin/g++ gives g++(ubuntu 11.4.0 lubuntu1-22.04) copyright 2021.
locate type_traits gives
$ locate type_traits.h
/home/marty/Qt/6.6.1/Src/qtbase/src/corelib/global/q20type_traits.h
/home/marty/Qt/6.6.1/Src/qtbase/src/corelib/global/qxptype_traits.h
/home/marty/Qt/6.6.1/Src/qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/meta/type_traits.h
/home/marty/Qt/6.6.1/Src/qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/strings/internal/stl_type_traits.h
/home/marty/Qt/6.6.1/Src/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/core/v8/v8_ctype_traits.h
/home/marty/Qt/6.6.1/Src/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/type_traits.h
/home/marty/Qt/6.6.1/Src/qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/type_traits.h
/home/marty/Qt/6.6.1/android_arm64_v8a/include/QtCore/q20type_traits.h
/home/marty/Qt/6.6.1/android_arm64_v8a/include/QtCore/qxptype_traits.h
/home/marty/Qt/6.6.1/android_armv7/include/QtCore/q20type_traits.h
/home/marty/Qt/6.6.1/android_armv7/include/QtCore/qxptype_traits.h
/home/marty/Qt/6.6.1/android_x86/include/QtCore/q20type_traits.h
/home/marty/Qt/6.6.1/android_x86/include/QtCore/qxptype_traits.h
/home/marty/Qt/6.6.1/android_x86_64/include/QtCore/q20type_traits.h
/home/marty/Qt/6.6.1/android_x86_64/include/QtCore/qxptype_traits.h
/home/marty/Qt/6.6.1/gcc_64/include/QtCore/q20type_traits.h
/home/marty/Qt/6.6.1/gcc_64/include/QtCore/qxptype_traits.h
/home/marty/Qt/6.6.1/wasm_multithread/include/QtCore/q20type_traits.h
/home/marty/Qt/6.6.1/wasm_multithread/include/QtCore/qxptype_traits.h
/home/marty/Qt/6.6.1/wasm_singlethread/include/QtCore/q20type_traits.h
/home/marty/Qt/6.6.1/wasm_singlethread/include/QtCore/qxptype_traits.h
/home/marty/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/include/QtCore/q20type_traits.h
/home/marty/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/include/QtCore/qxptype_traits.h
/usr/aarch64-linux-gnu/include/c++/11/bits/cpp_type_traits.h
/usr/aarch64-linux-gnu/include/c++/11/ext/type_traits.h
/usr/include/c++/11/bits/cpp_type_traits.h
/usr/include/c++/11/ext/type_traits.h
/usr/include/llvm-11/llvm/Support/type_traits.h
/usr/include/llvm-14/llvm/Support/type_traits.h
/usr/include/llvm-15/llvm/Support/type_traits.h
~$I'm using qtgreato,r with the compilers noted in my last post, to build the project from it's .pro file.
the .pro file
TEMPLATE = subdirs!contains(CONFIG, no_zint){
CONFIG += zint
}include(common.pri)
contains(CONFIG, zint){
SUBDIRS += 3rdparty
}export($$CONFIG)
CONFIG += ordered
SUBDIRS +=
limereport
demo_r1
demo_r2
console
designer!contains(CONFIG, embedded_designer){
!contains(CONFIG, static_build){
SUBDIRS += designer_plugin
}
}and the .pri file
CONFIG += zint
include(./limereport/limereport.pri)
contains(CONFIG, zint){
include(./qzint.pri)
}Zint is a 3rd party barcode generator that must be built before Lime Report. Lime Report can be downloaded fro Sourceforge. It is a report generator.
If there is another way to build this project without using qtcreator?
Marty
-
@ham13 said in type_traitsFile not found:
C Compiler - gcc(C, x86, 64 bit in /usr/bin)
C++ Compiler - CLANG 11(C++ , x86 64 bit in /usr/bin)I believe all gcc compilers above v8 support c-17.
That is C++17. I appears you are not using the GCC C++ compiler.
From the CLang LLVM docs:By default, Clang 16 or later builds C++ code according to the C++17 standard. You can use Clang in C++17 mode with the -std=c++17 option (use -std=c++1z in Clang 4 and earlier).
So, when you build your project, exactly how is the compiler invoked?
Do you have the GCC C++ to try? What version is that GCC compiler?
/usr/bin/g++ --version
Does the referenced file even exist on your machine?
$ locate type_traits.h /usr/include/c++/11/bits/cpp_type_traits.h /usr/include/c++/11/ext/type_traits.h
@ham13 said in type_traitsFile not found:
I'm using qtgreato,r with the compilers noted in my last post, to build the project from it's .pro file.
Your last post says you are using CLang 11 for C++ and your choice of Qt qmake says you are using GCC.
@ChrisW67 said in type_traitsFile not found:
So, when you build your project, exactly how is the compiler invoked?
Still unanswered but the next step will make this obvious.
@ham13 said in type_traitsFile not found:
If there is another way to build this project without using qtcreator?
Sure.
mkdir /tmp/build_dir cd /tmp/build_dir /home/XXX/qt/6.6.1/gcc_64/bin/qmake /path/to/source/project.pro make
(Exactly the same sort of steps that Qt Creator takes on your behalf).
-
@ham13 said in type_traitsFile not found:
I'm using qtgreato,r with the compilers noted in my last post, to build the project from it's .pro file.
Your last post says you are using CLang 11 for C++ and your choice of Qt qmake says you are using GCC.
@ChrisW67 said in type_traitsFile not found:
So, when you build your project, exactly how is the compiler invoked?
Still unanswered but the next step will make this obvious.
@ham13 said in type_traitsFile not found:
If there is another way to build this project without using qtcreator?
Sure.
mkdir /tmp/build_dir cd /tmp/build_dir /home/XXX/qt/6.6.1/gcc_64/bin/qmake /path/to/source/project.pro make
(Exactly the same sort of steps that Qt Creator takes on your behalf).
Used the code from the last post to build the Zint 3rd9arty part of QtRptProject. Build success. Tried the same code with the main project QtRptProject. Got errors. The last lines from the make file:
In file included from ../Qt/6.6.1/gcc_64/include/QtCore/qarraydata.h:8,
from ../Qt/6.6.1/gcc_64/include/QtCore/qarraydataops.h:8,
from ../Qt/6.6.1/gcc_64/include/QtCore/qarraydatapointer.h:7,
from ../Qt/6.6.1/gcc_64/include/QtCore/qlist.h:8,
from ../Qt/6.6.1/gcc_64/include/QtCore/qmap.h:9,
from ../Qt/6.6.1/gcc_64/include/QtCore/QMap:1,
from ../Applications/QtRptProject/QtRptProject_V3/QtRptProject_V3/CommonFiles/CommonClasses.h:25,
from ../Applications/QtRptProject/QtRptProject_V3/QtRptProject_V3/CommonFiles/CommonClasses.cpp:23:
../Qt/6.6.1/gcc_64/include/QtCore/qpair.h: In instantiation of ‘constexpr int qMakePair(T1&&, T2&&) [with T1 = QTypedArrayData<QString>; T2 = QString]’:
../Qt/6.6.1/gcc_64/include/QtCore/qarraydata.h:118:25: required from ‘static QPair<QTypedArrayData<T>, T> QTypedArrayData<T>::reallocateUnaligned(QTypedArrayData<T>, T, qsizetype, QArrayData::AllocationOption) [with T = QString; QPair<QTypedArrayData<T>, T> = std::pair<QTypedArrayData<QString>, QString>; qsizetype = long long int]’
../Qt/6.6.1/gcc_64/include/QtCore/qarraydataops.h:295:46: required from ‘void QtPrivate::QPodArrayOps<T>::reallocate(qsizetype, QArrayData::AllocationOption) [with T = QString; qsizetype = long long int]’
../Qt/6.6.1/gcc_64/include/QtCore/qarraydatapointer.h:217:36: required from ‘void QArrayDataPointer<T>::reallocateAndGrow(QArrayData::GrowthPosition, qsizetype, QArrayDataPointer<T>) [with T = QString; qsizetype = long long int]’
../Qt/6.6.1/gcc_64/include/QtCore/qarraydatapointer.h:139:13: required from ‘void QArrayDataPointer<T>::detach(QArrayDataPointer<T>) [with T = QString]’
../Qt/6.6.1/gcc_64/include/QtCore/qlist.h:409:29: required from ‘void QList<T>::detach() [with T = QString]’
../Qt/6.6.1/gcc_64/include/QtCore/qlist.h:609:22: required from ‘QList<T>::iterator QList<T>::end() [with T = QString]’
../Qt/6.6.1/gcc_64/include/QtCore/qlist.h:631:58: required from ‘T& QList<T>::last() [with T = QString]’
../Applications/QtRptProject/QtRptProject_V3/QtRptProject_V3/CommonFiles/CommonClasses.cpp:1119:18: required from here
../Qt/6.6.1/gcc_64/include/QtCore/qpair.h:22:26: error: cannot convert ‘std::pair<QTypedArrayData<QString>, QString>’ to ‘int’ in return
22 | return std::make_pair(std::forward<T1>(value1), std::forward<T2>(value2));
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
| |
| std::pair<QTypedArrayData<QString>, QString>
../Qt/6.6.1/gcc_64/include/QtCore/qpair.h:23:1: error: body of ‘constexpr’ function ‘constexpr int qMakePair(T1&&, T2&&) [with T1 = QTypedArrayData<QString>; T2 = QString]’ not a return-statement
23 | }
| ^
make[1]: *** [Makefile:10912: tmp-lin64/CommonClasses.o] Error 1
make[1]: Leaving directory '/home/marty/QtRptDesigner'
make: *** [Makefile:92: sub-QtRptDesigner-make_first-ordered] Error 2
marty@marty-GN551AA-ABA-m8200n:~$Where to now?
Thanks,
Marty -
Used the code from the last post to build the Zint 3rd9arty part of QtRptProject. Build success. Tried the same code with the main project QtRptProject. Got errors. The last lines from the make file:
In file included from ../Qt/6.6.1/gcc_64/include/QtCore/qarraydata.h:8,
from ../Qt/6.6.1/gcc_64/include/QtCore/qarraydataops.h:8,
from ../Qt/6.6.1/gcc_64/include/QtCore/qarraydatapointer.h:7,
from ../Qt/6.6.1/gcc_64/include/QtCore/qlist.h:8,
from ../Qt/6.6.1/gcc_64/include/QtCore/qmap.h:9,
from ../Qt/6.6.1/gcc_64/include/QtCore/QMap:1,
from ../Applications/QtRptProject/QtRptProject_V3/QtRptProject_V3/CommonFiles/CommonClasses.h:25,
from ../Applications/QtRptProject/QtRptProject_V3/QtRptProject_V3/CommonFiles/CommonClasses.cpp:23:
../Qt/6.6.1/gcc_64/include/QtCore/qpair.h: In instantiation of ‘constexpr int qMakePair(T1&&, T2&&) [with T1 = QTypedArrayData<QString>; T2 = QString]’:
../Qt/6.6.1/gcc_64/include/QtCore/qarraydata.h:118:25: required from ‘static QPair<QTypedArrayData<T>, T> QTypedArrayData<T>::reallocateUnaligned(QTypedArrayData<T>, T, qsizetype, QArrayData::AllocationOption) [with T = QString; QPair<QTypedArrayData<T>, T> = std::pair<QTypedArrayData<QString>, QString>; qsizetype = long long int]’
../Qt/6.6.1/gcc_64/include/QtCore/qarraydataops.h:295:46: required from ‘void QtPrivate::QPodArrayOps<T>::reallocate(qsizetype, QArrayData::AllocationOption) [with T = QString; qsizetype = long long int]’
../Qt/6.6.1/gcc_64/include/QtCore/qarraydatapointer.h:217:36: required from ‘void QArrayDataPointer<T>::reallocateAndGrow(QArrayData::GrowthPosition, qsizetype, QArrayDataPointer<T>) [with T = QString; qsizetype = long long int]’
../Qt/6.6.1/gcc_64/include/QtCore/qarraydatapointer.h:139:13: required from ‘void QArrayDataPointer<T>::detach(QArrayDataPointer<T>) [with T = QString]’
../Qt/6.6.1/gcc_64/include/QtCore/qlist.h:409:29: required from ‘void QList<T>::detach() [with T = QString]’
../Qt/6.6.1/gcc_64/include/QtCore/qlist.h:609:22: required from ‘QList<T>::iterator QList<T>::end() [with T = QString]’
../Qt/6.6.1/gcc_64/include/QtCore/qlist.h:631:58: required from ‘T& QList<T>::last() [with T = QString]’
../Applications/QtRptProject/QtRptProject_V3/QtRptProject_V3/CommonFiles/CommonClasses.cpp:1119:18: required from here
../Qt/6.6.1/gcc_64/include/QtCore/qpair.h:22:26: error: cannot convert ‘std::pair<QTypedArrayData<QString>, QString>’ to ‘int’ in return
22 | return std::make_pair(std::forward<T1>(value1), std::forward<T2>(value2));
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
| |
| std::pair<QTypedArrayData<QString>, QString>
../Qt/6.6.1/gcc_64/include/QtCore/qpair.h:23:1: error: body of ‘constexpr’ function ‘constexpr int qMakePair(T1&&, T2&&) [with T1 = QTypedArrayData<QString>; T2 = QString]’ not a return-statement
23 | }
| ^
make[1]: *** [Makefile:10912: tmp-lin64/CommonClasses.o] Error 1
make[1]: Leaving directory '/home/marty/QtRptDesigner'
make: *** [Makefile:92: sub-QtRptDesigner-make_first-ordered] Error 2
marty@marty-GN551AA-ABA-m8200n:~$Where to now?
Thanks,
Marty@ham13 Will try agian today. Asked the programs author about the errors. He replied "it builds for me on both qt5 and qt6". When I asked how he built it on qt6 got nothing but silence. Hope you all can help get this thing to build. I'll post what happens today when I try again.
Thanks,
Marty -
@ham13 Will try agian today. Asked the programs author about the errors. He replied "it builds for me on both qt5 and qt6". When I asked how he built it on qt6 got nothing but silence. Hope you all can help get this thing to build. I'll post what happens today when I try again.
Thanks,
Marty@ham13 I have the same result with Qt 6.6.1/GCC 11 on Ubuntu 22.04. I cannot yet see the connection between the line identified in the error and the type of error (std::pair-related type conversion issues)..
I do note, however, that some of the components are venerable and do things that cause problems. For example, QXlsx forces C++11 flags on the compiler, generating warnings about C++17 requirements (and probably plenty more). Zint appears to be of Qt4 vintage. Qt6 is supported though the QT5 compatibility layer.