TarsCloud / TarsCpp

C++ language framework rpc source code implementation
BSD 3-Clause "New" or "Revised" License
523 stars 254 forks source link

在g++11的版本上有编译错误 #239

Open ralf997 opened 2 years ago

ralf997 commented 2 years ago

image

In file included from /root/down/TarsCpp/build/src/gtest-lib/googletest/src/gtest-all.cc:42:
/root/down/TarsCpp/build/src/gtest-lib/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
/root/down/TarsCpp/build/src/gtest-lib/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
 1301 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/root/down/TarsCpp/build/src/gtest-lib/googletest/src/gtest-death-test.cc:1290:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here 1290 | static void StackLowerThanAddress(const void* ptr, bool* result) {
      |             ^~~~~~~~~~~~~~~~~~~~~
/root/down/TarsCpp/build/src/gtest-lib/googletest/src/gtest-death-test.cc:1299:7: note: ‘dummy’ declared here
 1299 |   int dummy;
      |       ^~~~~
cc1plus: all warnings being treated as errors
ruanshudong commented 2 years ago

看起来是gtest版本的问题, 等下个版本升级一下gtest

ralf997 commented 2 years ago

的确是gtest版本问题, 换了新版本就好了 我把cmake/Thirdparty.cmake里面的 http://cdn.tarsyun.com/src/release-1.10.0.tar.gz 换成 https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz 然后再改下URL_MD5就可以正常编译了

ruanshudong commented 2 years ago

还不能直接升级, 升级了低版本gcc又编译不过了, 蛋疼