-2

i am use google test c++ freamwork to test my project but facing some issue for your reference see the compilation errors as follow.

src/exclusions/Gtest/../../include/gtest/internal/gtest-port.h:972:37: error: ‘nullptr’ was not declared in this scope
src/exclusions/Gtest/../../include/gtest/internal/gtest-port.h:1316:22: error: expected ‘;’ before ‘override’
src/exclusions/Gtest/../../include/gtest/internal/../gtest-matchers.h:307:37: error: ‘testing::internal::MatcherBase<T>::MatcherBase(const testing::internal::MatcherBase<T>&)’ declared with non-public access cannot be defaulted in the class body
/home/buildserver/rswork25Nov/Dev-UEM-1.2-POC/src/exclusions/Gtest/../../include/gtest/internal/../gtest-matchers.h:308:48: error: ‘testing::internal::MatcherBase<T>& testing::internal::MatcherBase<T>::operator=(const testing::internal::MatcherBase<T>&)’ declared with non-public access cannot be defaulted in the class body
src/exclusions/Gtest/../../include/gtest/internal/gtest-param-util.h:521:74: error: there are no arguments to ‘InstantiationInfo’ that depend on a template parameter, so a declaration of ‘InstantiationInfo’ must be available
src/exclusions/Gtest/../../include/gtest/internal/../gtest-matchers.h:305:61: error: cannot allocate an object of abstract type ‘testing::internal::MatcherInterfaceAdapter<std::basic_string<char> >’
Alan Birtles
  • 32,622
  • 4
  • 31
  • 60
Dhiraj
  • 13
  • 7
  • 1
    Please post the logs in proper format for better readability. – Vaibhav Sharma Jan 21 '20 at 06:02
  • 3
    GCC 4.5 is quite old. Have you considered using a newer compiler? Then you could enjoy C++11/14/17 support, which your current compiler is too old to support. – Jesper Juhl Jan 21 '20 at 06:14
  • @VaibhavSharma OP will have trouble formatting that properly (i.e. as code) because the system will then tell them that they need to provide more prose explanation with that much code. – Yunnosch Jan 21 '20 at 06:23
  • 1
    You need at least gcc 4.6 https://stackoverflow.com/questions/3756473/what-header-file-needs-to-be-included-for-using-nullptr-in-g/3756481#3756481 – Alan Birtles Jan 21 '20 at 07:30

1 Answers1

1

Maybe you can resort to older tag of googletest?

Compare 1.8.1 requirements:

Linux Requirements

These are the base requirements to build and use Google Test from a source package (as described below):

GNU-compatible Make or gmake
POSIX-standard shell
POSIX(-2) Regular Expressions (regex.h)
A C++98-standard-compliant compiler

with the latest one:

Build Requirements

These are the base requirements to build and use Google Test from a source package:

Bazel or CMake. NOTE: Bazel is the build system that googletest is using internally and tests against. CMake is community-supported.

a C++11-standard-compliant compiler

I guess you have to make a tradeoff: compatibility with your toolchain for googletest features.

Oo.oO
  • 12,464
  • 3
  • 23
  • 45
  • @Dhiraj : Extra compilers are available for the most OS. Debian / Ubuntu examples https://drive.google.com/drive/folders/1xVEATaYAwqvseBzYxKDzJoZ4-Hc_XOJm?usp=sharing ... and Fedora / CentOS, etc. https://stackoverflow.com/questions/47175706/how-to-install-gcc-4-9-2-on-rhel-7-4/47189915#47189915 – Knud Larsen Jan 22 '20 at 01:17