luceneplusplus / LucenePlusPlus

Lucene++ is an up to date C++ port of the popular Java Lucene library, a high-performance, full-featured text search engine.
luceneplusplus@googlegroups.com
Other
738 stars 232 forks source link

Errors When Compiling on Ubuntu 22.04 #187

Open ghost opened 2 years ago

ghost commented 2 years ago

I am getting these errors while compiling, on Ubuntu 22.04:

In file included from /home/krixano/LucenePlusPlus/src/test/gtest/googletest/src/gtest-all.cc:42:
/home/krixano/LucenePlusPlus/src/test/gtest/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
/home/krixano/LucenePlusPlus/src/test/gtest/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
 1301 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/krixano/LucenePlusPlus/src/test/gtest/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) {
      |             ^~~~~~~~~~~~~~~~~~~~~
/home/krixano/LucenePlusPlus/src/test/gtest/googletest/src/gtest-death-test.cc:1299:7: note: ‘dummy’ declared here
 1299 |   int dummy;
      |       ^~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [src/test/gtest/googletest/CMakeFiles/gtest.dir/build.make:76: src/test/gtest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:882: src/test/gtest/googletest/CMakeFiles/gtest.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Gcc Version: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0

LocutusOfBorg commented 1 year ago

Hello, just don't use the gtest? there is one available with apt, or just apt-get source lucene++ and build from there. There are few patches and configuration switches.

ghost commented 1 year ago

@LocutusOfBorg It is not my job to fix other people's build systems. If things don't compile correctly using the provided build files, then the programming team needs to fix that, not the users who don't want to waste time fixing other people's mistakes.

The programming team should also not be so slow to read and respond to these issues. I've already found a solution and moved on.

alanw commented 1 year ago

I guess "the programming team" in this case is me?

I certainly don't want to waste your time, but at the same time I don't have access to Ubuntu or the time to deep dive into this particular problem, apologies.

LocutusOfBorg commented 1 year ago

@krixano using bundled libraries is considered bad pratice in Debian and Ubuntu, this is why I suggested you to just use system provided googletest. Or just build with -DENABLE_TEST=OFF

LocutusOfBorg commented 1 year ago

Also, works for me in the very same Ubuntu version, as well as Debian, so unless you provide build flags, and steps to reproduce, I guess there is not much we can do.

kmatheussen commented 1 year ago

Reading the error message, the obvious solution is setting the dummy variable to 0, or any other value. Haven't you tried that?

On Mon, Feb 20, 2023 at 8:18 PM Gianfranco Costamagna < @.***> wrote:

Also, works for me in the very same Ubuntu version, as well as Debian, so unless you provide build flags, and steps to reproduce, I guess there is not much we can do.

— Reply to this email directly, view it on GitHub https://github.com/luceneplusplus/LucenePlusPlus/issues/187#issuecomment-1437451523, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIX3J22V76YKRO6RUXZ4VTWYO7QXANCNFSM54FNO7JA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kmatheussen commented 1 year ago

(my message was of course directed at the thread starter, not Cianfranco)

On Mon, Feb 20, 2023 at 9:21 PM Kjetil Matheussen @.***> wrote:

Reading the error message, the obvious solution is setting the dummy variable to 0, or any other value. Haven't you tried that?

On Mon, Feb 20, 2023 at 8:18 PM Gianfranco Costamagna < @.***> wrote:

Also, works for me in the very same Ubuntu version, as well as Debian, so unless you provide build flags, and steps to reproduce, I guess there is not much we can do.

— Reply to this email directly, view it on GitHub https://github.com/luceneplusplus/LucenePlusPlus/issues/187#issuecomment-1437451523, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIX3J22V76YKRO6RUXZ4VTWYO7QXANCNFSM54FNO7JA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

LocutusOfBorg commented 1 year ago

Well, OTOH updating googletest to latest version will indeed fix this and other problems https://github.com/google/googletest/commit/4679637f1c9d5a0728bdc347a531737fad0b1ca3

V1.13.0 has the fix