Skip to content
This repository was archived by the owner on Jul 8, 2024. It is now read-only.
This repository was archived by the owner on Jul 8, 2024. It is now read-only.

Compilation fails due to deprecation and -Werror #203

Open

Description

Following the installation instructions I run

$ cmake -DCMAKE_BUILD_TYPE=Release ..

This fails with a long error log, but the salient points seem to be that it tries to build something that specifies -Werror and also uses deprecated functions, which causes a warning:

...
/home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/gmock-matchers.h:432:67: error: implicitly-declared ‘testing::internal::EndsWithMatcher<std::__cxx11::basic_string<wchar_t> >::EndsWithMatcher(const testing::internal::EndsWithMatcher<std::__cxx11::basic_string<wchar_t> >&)’ is deprecated [-Werror=deprecated-copy]
  432 |   explicit PolymorphicMatcher(const Impl& an_impl) : impl_(an_impl) {}
      |                                                                   ^
In file included from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googletest/include/gtest/internal/gtest-linked_ptr.h:74,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/internal/gmock-port.h:53,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/internal/gmock-generated-internal-utils.h:44,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/internal/gmock-internal-utils.h:45,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/gmock-actions.h:46,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/gmock.h:58,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/src/gmock-all.cc:40:
/home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googletest/include/gtest/internal/gtest-port.h:908:8: note: because ‘testing::internal::EndsWithMatcher<std::__cxx11::basic_string<wchar_t> >’ has user-provided ‘void testing::internal::EndsWithMatcher<StringType>::operator=(const testing::internal::EndsWithMatcher<StringType>&) [with StringType = std::__cxx11::basic_string<wchar_t>]’
  908 |   void operator=(type const &)
      |        ^~~~~~~~
/home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/gmock-matchers.h:1320:3: note: in expansion of macro ‘GTEST_DISALLOW_ASSIGN_’
 1320 |   GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);
      |   ^~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[5]: *** [googlemock/CMakeFiles/gmock.dir/build.make:95: googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o] Error 1
make[5]: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
make[5]: *** [googlemock/CMakeFiles/gmock_main.dir/build.make:95: googlemock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.o] Error 1
[ 63%] Linking CXX static library libgtest.a
make[4]: *** [CMakeFiles/Makefile2:164: googlemock/CMakeFiles/gmock.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [CMakeFiles/Makefile2:137: googlemock/CMakeFiles/gmock_main.dir/all] Error 2
[ 63%] Built target gtest
make[3]: *** [Makefile:160: all] Error 2
make[2]: *** [CMakeFiles/GTest-Release.dir/build.make:134: GTest-Release-prefix/src/GTest-Release-stamp/GTest-Release-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:153: CMakeFiles/GTest-Release.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

[hunter ** FATAL ERROR **] Build step failed (dir: /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest
[hunter ** FATAL ERROR **] [Directory:/home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/projects/GTest]

------------------------------ ERROR -----------------------------
    https://docs.hunter.sh/en/latest/reference/errors/error.external.build.failed.html
------------------------------------------------------------------

CMake Error at etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
  etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
  etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/modules/hunter_download.cmake:617 (hunter_fatal_error)
  etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/projects/GTest/hunter.cmake:244 (hunter_download)
  etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
  CMakeLists.txt:80 (hunter_add_package)


-- Configuring incomplete, errors occurred!
See also "/home/athas/repos/ADBench/my-build/CMakeFiles/CMakeOutput.log"

I can provide the whole log if needed, but it's mostly the same thing on repeat, so I don't think there is another root cause.

I'm using GCC 10.2.0.

Activity

  1. athas commented on Feb 21, 2021

    @athas
    ContributorAuthor

    Using cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=OFF .. skips the problematic package (GTest) and allows cmake to finish.

  2. toelli-msft commented on Feb 22, 2021

    @toelli-msft
    Contributor

    Alan Lawrence (@acl33) Is this the same issue that you came across?

  3. dcrc2 commented on Feb 22, 2021

    @dcrc2

    It looks like this would be fixed by using a more recent version of googletest: see google/googletest#2815

  4. toelli-msft commented on Feb 22, 2021

    @toelli-msft
    Contributor

    Thanks for spotting that. We should give it a go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions