Closed zhangyi1357 closed 4 days ago
When I tried to fix the issue, another problem with GoogleTest comes up.
In file included from /home/zy/learning/my-trpc-cpp/cmake_third_party/gtest/googletest/src/gtest-all.cc:42:
/home/zy/learning/my-trpc-cpp/cmake_third_party/gtest/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
/home/zy/learning/my-trpc-cpp/cmake_third_party/gtest/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
1301 | StackLowerThanAddress(&dummy, &result);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
It has been solved by https://github.com/google/googletest/pull/3024, we only need to update GoogleTest to use version 1.11.0 or newer.
When using cc_proto_library, bazel will use a specific version of protobuf to generate .pb.h/.pb.cc stub code.
Starting from bazel-7, we can't change version of protobuf by simply declare a com_google_protobuf
bazel repository (it does work in bazel-1~bazel-6). So the stub code will be genreated using protobuf-3.21.8 and can't compatible with trpc-cpp protobuf-3.15.8 which causes compile error.
To resolve this problem, just downgrade bazel version to bazel-6.
@weimch I'm not using Bazel, I'm using CMake.
@weimch I'm not using Bazel, I'm using CMake.
sor, thought you were the guy asking compile error in private.
Already solved by @zhangyi1357 at https://github.com/trpc-group/trpc-cpp/pull/167. Thanks for contribution.
What version of tRPC-Cpp are you using?
v1.2.0
What operating system and compiler are you using?
OS: Arch Linux on Windows 10 x86_64 Kernel: 5.15.133.1-microsoft-standard-WSL2 Compiler: g++ (GCC) 14.2.1 20240802
What did you do?
After cloning the project just run the following command under project root directory.
What did you expect to see?
No compilation errors.
What did you see instead?
Just show the core errors:
Full build log: build.log
How to fix
I'd like to fix above compilation problems.
For error 1, just do a patch on rapidjson like what has been done for spdlog.
For error 2, just do the following change: