GoogleTest compatibility ?
-
wrote on 23 Oct 2022, 21:00 last edited by
I failed to build qtcreator-4.14.2, with the following ERROR messages:
[ 2%] Building CXX object src/shared/qtlockedfile/CMakeFiles/shared_qtlockedfile.dir/qtlockedfile.cpp.o cd ......-creator/qt-creator/build_22.04/src/shared/qtlockedfile && /usr/bin/c++ -DQT_CORE_LIB -DQT_NO_DEBUG -I......-creator/qt-creator/build_22.04/src/shared/qtlockedfile -I......-creator/qt-creator/src/shared/qtlockedfile -I......-creator/qt-creator/build_22.04/src/shared/qtlockedfile/shared_qtlockedfile_autogen/include -isystem /opt/qt/5/include -isystem /opt/qt/5/include/QtCore -isystem /opt/qt/5/./mkspecs/linux-g++ -O3 -DNDEBUG -Wno-missing-field-initializers -fPIC -std=c++17 -MD -MT src/shared/qtlockedfile/CMakeFiles/shared_qtlockedfile.dir/qtlockedfile.cpp.o -MF CMakeFiles/shared_qtlockedfile.dir/qtlockedfile.cpp.o.d -o CMakeFiles/shared_qtlockedfile.dir/qtlockedfile.cpp.o -c ......-creator/qt-creator/src/shared/qtlockedfile/qtlockedfile.cpp In file included from /opt/google/googletest/googletest/src/gtest-all.cc:43: /opt/google/googletest/googletest/src/../src/gtest-filepath.cc:148:8: error: no declaration matches ‘size_t testing::internal::FilePath::CalculateRootLength() const’ 148 | size_t FilePath::CalculateRootLength() const { | ^~~~~~~~ /opt/google/googletest/googletest/src/../src/gtest-filepath.cc:148:8: note: no functions named ‘size_t testing::internal::FilePath::CalculateRootLength() const’ In file included from /usr/local/include/gtest/internal/gtest-internal.h:70, from /usr/local/include/gtest/gtest-printers.h:114, from /usr/local/include/gtest/gtest-matchers.h:48, from /usr/local/include/gtest/internal/gtest-death-test-internal.h:46, from /usr/local/include/gtest/gtest-death-test.h:43, from /usr/local/include/gtest/gtest.h:60, from /opt/google/googletest/googletest/src/gtest-all.cc:38: /usr/local/include/gtest/internal/gtest-filepath.h:64:18: note: ‘class testing::internal::FilePath’ defined here 64 | class GTEST_API_ FilePath { | ^~~~~~~~ In file included from /opt/google/googletest/googletest/src/gtest-all.cc:43: /opt/google/googletest/googletest/src/../src/gtest-filepath.cc: In member function ‘bool testing::internal::FilePath::IsRootDirectory() const’: /opt/google/googletest/googletest/src/../src/gtest-filepath.cc:290:24: error: ‘CalculateRootLength’ was not declared in this scope 290 | size_t root_length = CalculateRootLength(); | ^~~~~~~~~~~~~~~~~~~ /opt/google/googletest/googletest/src/../src/gtest-filepath.cc: In member function ‘bool testing::internal::FilePath::IsAbsolutePath() const’: /opt/google/googletest/googletest/src/../src/gtest-filepath.cc:297:10: error: ‘CalculateRootLength’ was not declared in this scope 297 | return CalculateRootLength() > 0; | ^~~~~~~~~~~~~~~~~~~ [ 2%] Building C object src/libs/3rdparty/syntax-highlighting/CMakeFiles/QtCreatorPchGui.dir/cmake_pch.h.gch
I'm using gcc 11.2.0 under Ubuntu 22.04.1
➜ ~ gcc --version gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0 Copyright (C) 2021 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.
Did anybody meet the same issue???
-
I failed to build qtcreator-4.14.2, with the following ERROR messages:
[ 2%] Building CXX object src/shared/qtlockedfile/CMakeFiles/shared_qtlockedfile.dir/qtlockedfile.cpp.o cd ......-creator/qt-creator/build_22.04/src/shared/qtlockedfile && /usr/bin/c++ -DQT_CORE_LIB -DQT_NO_DEBUG -I......-creator/qt-creator/build_22.04/src/shared/qtlockedfile -I......-creator/qt-creator/src/shared/qtlockedfile -I......-creator/qt-creator/build_22.04/src/shared/qtlockedfile/shared_qtlockedfile_autogen/include -isystem /opt/qt/5/include -isystem /opt/qt/5/include/QtCore -isystem /opt/qt/5/./mkspecs/linux-g++ -O3 -DNDEBUG -Wno-missing-field-initializers -fPIC -std=c++17 -MD -MT src/shared/qtlockedfile/CMakeFiles/shared_qtlockedfile.dir/qtlockedfile.cpp.o -MF CMakeFiles/shared_qtlockedfile.dir/qtlockedfile.cpp.o.d -o CMakeFiles/shared_qtlockedfile.dir/qtlockedfile.cpp.o -c ......-creator/qt-creator/src/shared/qtlockedfile/qtlockedfile.cpp In file included from /opt/google/googletest/googletest/src/gtest-all.cc:43: /opt/google/googletest/googletest/src/../src/gtest-filepath.cc:148:8: error: no declaration matches ‘size_t testing::internal::FilePath::CalculateRootLength() const’ 148 | size_t FilePath::CalculateRootLength() const { | ^~~~~~~~ /opt/google/googletest/googletest/src/../src/gtest-filepath.cc:148:8: note: no functions named ‘size_t testing::internal::FilePath::CalculateRootLength() const’ In file included from /usr/local/include/gtest/internal/gtest-internal.h:70, from /usr/local/include/gtest/gtest-printers.h:114, from /usr/local/include/gtest/gtest-matchers.h:48, from /usr/local/include/gtest/internal/gtest-death-test-internal.h:46, from /usr/local/include/gtest/gtest-death-test.h:43, from /usr/local/include/gtest/gtest.h:60, from /opt/google/googletest/googletest/src/gtest-all.cc:38: /usr/local/include/gtest/internal/gtest-filepath.h:64:18: note: ‘class testing::internal::FilePath’ defined here 64 | class GTEST_API_ FilePath { | ^~~~~~~~ In file included from /opt/google/googletest/googletest/src/gtest-all.cc:43: /opt/google/googletest/googletest/src/../src/gtest-filepath.cc: In member function ‘bool testing::internal::FilePath::IsRootDirectory() const’: /opt/google/googletest/googletest/src/../src/gtest-filepath.cc:290:24: error: ‘CalculateRootLength’ was not declared in this scope 290 | size_t root_length = CalculateRootLength(); | ^~~~~~~~~~~~~~~~~~~ /opt/google/googletest/googletest/src/../src/gtest-filepath.cc: In member function ‘bool testing::internal::FilePath::IsAbsolutePath() const’: /opt/google/googletest/googletest/src/../src/gtest-filepath.cc:297:10: error: ‘CalculateRootLength’ was not declared in this scope 297 | return CalculateRootLength() > 0; | ^~~~~~~~~~~~~~~~~~~ [ 2%] Building C object src/libs/3rdparty/syntax-highlighting/CMakeFiles/QtCreatorPchGui.dir/cmake_pch.h.gch
I'm using gcc 11.2.0 under Ubuntu 22.04.1
➜ ~ gcc --version gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0 Copyright (C) 2021 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.
Did anybody meet the same issue???
@jiapei1000 said in GoogleTest compatibility ?:
I failed to build qtcreator-4.14.2....
I'm using gcc 11.2.0 under Ubuntu 22.04.1
Qt Creator 4.14 is quite old, but Ubuntu 22.04 is quite new. Most likely you have a newer version of GoogleTest that is backward-incompatible with the version used by Qt Creator 4.14.
May I ask why you want to build Qt Creator 4.14? Your have other options:
- Build a newer version: https://download.qt.io/official_releases/qtcreator/ OR
- Download and run the installer for Qt Creator 4.14: https://download.qt.io/archive/qtcreator/4.14/4.14.2/qt-creator-opensource-linux-x86_64-4.14.2.run
-
@jiapei1000 said in GoogleTest compatibility ?:
I failed to build qtcreator-4.14.2....
I'm using gcc 11.2.0 under Ubuntu 22.04.1
Qt Creator 4.14 is quite old, but Ubuntu 22.04 is quite new. Most likely you have a newer version of GoogleTest that is backward-incompatible with the version used by Qt Creator 4.14.
May I ask why you want to build Qt Creator 4.14? Your have other options:
- Build a newer version: https://download.qt.io/official_releases/qtcreator/ OR
- Download and run the installer for Qt Creator 4.14: https://download.qt.io/archive/qtcreator/4.14/4.14.2/qt-creator-opensource-linux-x86_64-4.14.2.run
wrote on 25 Oct 2022, 07:44 last edited by jiapei1000@JKSH My bad... I found qt-creator probably from archive, rather than official_releases...
Problem solved....
But, one thing: I need to comment out line 121
// style.ConstructorInitializerAllOnOneLineOrOnePerLine = false;
of file....../qt-creator-opensource-src-8.0.2/src/plugins/clangformat/clangformatutils.cpp
.
1/3