0

I am using Waf as a build tool to build a C++ library. I had earlier been using GCC 4.8.x and using std=c++98, and it was working fine

However, when I tried to change the compiler version to GCC 7.2, there were a host of issues all related to Gtest. Ex : undefined reference to `testing::internal::PrintStringTo

I would be grateful if someone could kindly share some information on how to eliminate this issue, while retaining the unit tests written through Gtest

regards, Tej

aschepler
  • 70,891
  • 9
  • 107
  • 161
  • 2
    Are you still trying to use the same gtest library binary, or did you rebuild the library using gcc 7.2? – aschepler Feb 26 '18 at 04:17
  • 1
    Hi aschepler, I did not rebuild the binary, which is probably why it is causing a mismatch when trying to link. Can you kindly let me know how I can install gtest source and build it with GCC 7.x ? -Tej – Tejaswi Haramurali Feb 26 '18 at 04:22
  • what gtest version you are using? Latest or some earlier? What C++ standard - c++98, C++11, C++14 or C++17 (latest) or just default for gcc7.2 (C++14 I guess)? – PiotrNycz Mar 01 '18 at 11:41
  • having same issue. Have you found any fixes? – Kanwar Saad Nov 18 '18 at 00:19

1 Answers1

0

gtest is depended from used compiler, so, take a gtest source code wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz and install it using your compiler as a default compiler