Hi, is it always necessary to link to the pthread library in addition
to gtest or gtest_main on linux systems that support it? Is there a
reason that the default makefile doesn't just link the pthread library
to the gtest library to avoid having to do this? Also, if it's not
necessary to compile the gtest libraries, why not make it only
necessary when actually using threads. I'm only running a simple test
using TEST() and EXPECT_EQ, so it seems like linking to pthread is
overkill. I would prefer to only have to link to pthread if we
actually use some of those features in Google Test. Thoughts?
Thanks.
- Daniel
P.S. I know that it's possible to edit the makeful to disable thread
support altogether, but I don't want to do that.
Thanks. Is there a way to compile with pthreads support enabled
without having to link every test binary to the pthread library?
That's what I'm doing now because even for very simple tests gcc
complains if I don't link to pthread.
Thanks.
On Aug 19, 8:46 pm, Vlad Losev <v...@losev.com> wrote:
> You may run ./configure with --with-pthreads=no. Alternatively, use
>
> CPPFLAGS='-DGTEST_HAS_PTHREAD=0' make ....