New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Googletest does not compile with POSIX Threads for Windows #3577
Labels
Comments
ingo-h
added a commit
to upnplib/upnplib
that referenced
this issue
Sep 26, 2021
Make Unit Tests running with the new GoogleTest Installation and found that GoogleMock segfaults if compiled without PThreads. I tried it because it is necessary on MS Windows to successfully compile there. See bug report google/googletest#3577. The bad news, we cannot setup consistently: - we MUST GoogleTest compile with pthread on Linux - we MUST GoogleTest compile without pthreads4w on MS Windows to be able to use mocking.
ingo-h
added a commit
to upnplib/upnplib
that referenced
this issue
Sep 26, 2021
Make Unit Tests running with the new GoogleTest Installation and found that GoogleMock segfaults if compiled without PThreads. I tried it because it is necessary on MS Windows to successfully compile there. See bug report google/googletest#3577. The bad news, we cannot setup consistently: - we MUST GoogleTest compile with pthread on Linux - we MUST GoogleTest compile without pthreads4w on MS Windows to be able to use mocking.
I had this same issue and it turned out that two preprocesser macros were conflicting with one another. Specifically, these two macros in gtest-port.h both returned true and defined the class
I ended up fixing it by changing |
hobu
added a commit
to PDAL/PDAL
that referenced
this issue
Feb 12, 2023
google/googletest#3577 (comment) Weird pthread interaction in gtest in some windows builds
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
pthreads4w is installed and working. I can compile programs with it. If I build googletest with default settings it does not detect pthread. pthreads4w can only be compiled with Generator "NMake Makefiles". If I try to also compile googletest with that Generator build fails with a bunch of error messages.
I expect that configuration and build of googletest detect third party pthread installation on Microsoft Windows and successful compile it with default Generator "Visual Studio *" and with Generator "NMake Makefiles" and then use POSIX threads.
Steps to reproduce the bug
First Install third party POSIX Threads for Windows. Then configure googletest with default settings using PowerShell:
As shown header files are found but pthread isn't detected. Following build of googletest works but without multithreading. If Configuring with Generator "NMake Makefiles" I get:
Looks good so far. But with building I get:
Does the bug persist in the most recent commit?
Yes.
What operating system and version are you using?
From a cmd prompt:
What compiler and version are you using?
What build system are you using?
The text was updated successfully, but these errors were encountered: