MerginMaps / db-sync

A tool for two-way synchronization between Mergin Maps and a PostGIS database
https://merginmaps.com
MIT License
45 stars 20 forks source link

Compilation fails with gtest-death-test.cc #93

Closed timlinux closed 1 year ago

timlinux commented 1 year ago

Following the steps in https://github.com/MerginMaps/mergin-db-sync#installation to compile geodiff I get this error:

[ 71%] Building CXX object tests/CMakeFiles/geodifftestutils.dir/geodiff_testutils.cpp.o
[ 71%] Built target geodifftestutils
[ 74%] Building CXX object googletest-build/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
In file included from /home/timlinux/dev/cpp/geodiff/build/googletest-src/googletest/src/gtest-all.cc:42:
/home/timlinux/dev/cpp/geodiff/build/googletest-src/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
/home/timlinux/dev/cpp/geodiff/build/googletest-src/googletest/src/gtest-death-test.cc:1224:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
 1224 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/timlinux/dev/cpp/geodiff/build/googletest-src/googletest/src/gtest-death-test.cc:1214:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here
 1214 | static void StackLowerThanAddress(const void* ptr, bool* result) {
      |             ^~~~~~~~~~~~~~~~~~~~~
/home/timlinux/dev/cpp/geodiff/build/googletest-src/googletest/src/gtest-death-test.cc:1222:7: note: ‘dummy’ declared here
 1222 |   int dummy;
      |       ^~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [googletest-build/googlemock/gtest/CMakeFiles/gtest.dir/build.make:76: googletest-build/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1134: googletest-build/googlemock/gtest/CMakeFiles/gtest.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
wonder-sk commented 1 year ago

hi @timlinux is it possible that you had this build directory from some earlier times? It looks like it is using some older version of GTest library - please try to do a clean build, that should help!