Closed black-eagle17 closed 2 years ago
Hi, thanks for reporting!
So cmake fails to build googletest with the following error:
/home/deandre/dev/cpp/rt-tests/build/googletest-src/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
/home/deandre/dev/cpp/rt-tests/build/googletest-src/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
1301 | StackLowerThanAddress(&dummy, &result);
Which means that googletest enabled -Werror
(treat warnings as errors) and then compiler emitted warning, which failed the buiild. I guess you're using a very recent gcc or clang which detects more warnings compared to previous versions.
-Werror
is enabled here: https://github.com/google/googletest/blob/release-1.10.0/googletest/cmake/internal_utils.cmake
But it turns out that in the next release (1.11) they already removed it: https://github.com/google/googletest/blob/release-1.11.0/googletest/cmake/internal_utils.cmake
So I just bumped googletest version. Please let me know if this fixes the issue for you.
For convenience, I also added a makefile to the root of the project, and updated instructions in README.
Thank you for the fix, works like a charm. I did manage to build google-test from its repository and everything went well. I should have probably picked up on the versioning issue just by doing that. Thank you for explaining the issue so well to me. I will go ahead and close this issue then. @gavv
Greetings @gavv, I am new to open source project development. The issue is that whenever I try to build this project, and call
make
. it gives mecommand failed: 2
make
This happens in the filert-tests/build/googletest-prefix/src/googletest-stamp/googletest-build-Debug.cmake:49 (message):
I have attached two log files if that can be of any help. Thanks in advance. googletest-build-out.log googletest-build-err.log