cpp-cryptlite icon indicating copy to clipboard operation
cpp-cryptlite copied to clipboard

Pthread does not found by the gtest-all: instruction does not works

Open johnynsk opened this issue 4 years ago • 0 comments

For the manual of the Readme file, I've just created a build directory, run cmake as it follows on the second point of manual, and tried to call "make". But I've got a problem:


 Wed 21 Apr - 12:31  ~/projects/github/cpp-cryptlite   origin ☊ master ✔ 
 user@localhost  mkdir build

 Wed 21 Apr - 12:31  ~/projects/github/cpp-cryptlite   origin ☊ master ✔                                                                                                 user@localhost  cd build
                                                                                                                                                                             Wed 21 Apr - 12:31  ~/projects/github/cpp-cryptlite/build   origin ☊ master ✔ 
 user@localhost  cmake .. -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release                                                                                              -- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1                                                                                                                            -- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done                                                                                                                                     -- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features                                                                                                                                             -- Detecting C compile features - done
-- Detecting CXX compiler ABI info                                                                                                                                          -- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped                                                                                                                   -- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /usr/include (found version "1.67.0")                                                                                                                       -- Configuring done
-- Generating done                                                                                                                                                          -- Build files have been written to: /home/user/projects/github/cpp-cryptlite/build

 Wed 21 Apr - 12:31  ~/projects/github/cpp-cryptlite/build   origin ☊ master ✔ 
 user@localhost  make
Scanning dependencies of target gtest-main
[  8%] Building CXX object gtest/CMakeFiles/gtest-main.dir/src/gtest_main.cc.o
[ 16%] Linking CXX static library libgtest-main.a
[ 16%] Built target gtest-main
Scanning dependencies of target gtest
[ 25%] Building CXX object gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 33%] Linking CXX static library libgtest.a
[ 33%] Built target gtest
Scanning dependencies of target sha256Test
[ 41%] Building CXX object tests/CMakeFiles/sha256Test.dir/sha256Test.cpp.o
[ 50%] Linking CXX executable sha256Test
/usr/bin/ld: ../gtest/libgtest.a(gtest-all.cc.o): in function `testing::internal::UnitTestImpl::~UnitTestImpl()':
gtest-all.cc:(.text+0x3734): undefined reference to `pthread_getspecific'
/usr/bin/ld: gtest-all.cc:(.text+0x374f): undefined reference to `pthread_key_delete'
/usr/bin/ld: gtest-all.cc:(.text+0x39ad): undefined reference to `pthread_getspecific'
/usr/bin/ld: gtest-all.cc:(.text+0x39c5): undefined reference to `pthread_key_delete'
/usr/bin/ld: ../gtest/libgtest.a(gtest-all.cc.o): in function `testing::internal::UnitTestImpl::UnitTestImpl(testing::UnitTest*)':
gtest-all.cc:(.text+0xfc47): undefined reference to `pthread_key_create'
/usr/bin/ld: gtest-all.cc:(.text+0xfde7): undefined reference to `pthread_key_create'
/usr/bin/ld: ../gtest/libgtest.a(gtest-all.cc.o): in function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::~ThreadLocal()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED
5Ev]+0xc): undefined reference to `pthread_getspecific'
/usr/bin/ld: gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporte
rInterfaceEED5Ev]+0x21): undefined reference to `pthread_key_delete'
/usr/bin/ld: ../gtest/libgtest.a(gtest-all.cc.o): in function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::Tr
aceInfo> > >::~ThreadLocal()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED5Ev]+0xe):
 undefined reference to `pthread_getspecific'
/usr/bin/ld: gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_E
EED5Ev]+0x25): undefined reference to `pthread_key_delete'
/usr/bin/ld: ../gtest/libgtest.a(gtest-all.cc.o): in function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::Tr
aceInfo> > >::GetOrCreateValue() const':
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESa
IS3_EEE16GetOrCreateValueEv]+0x14): undefined reference to `pthread_getspecific'
/usr/bin/ld: gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_
9TraceInfoESaIS3_EEE16GetOrCreateValueEv]+0x163): undefined reference to `pthread_setspecific'
/usr/bin/ld: ../gtest/libgtest.a(gtest-all.cc.o): in function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::GetOrCreateValue() const':
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultRe
porterInterfaceEE16GetOrCreateValueEv]+0xc): undefined reference to `pthread_getspecific'
/usr/bin/ld: gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_31Tes
tPartResultReporterInterfaceEE16GetOrCreateValueEv]+0x56): undefined reference to `pthread_setspecific'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/sha256Test.dir/build.make:105: tests/sha256Test] Error 1
make[1]: *** [CMakeFiles/Makefile2:239: tests/CMakeFiles/sha256Test.dir/all] Error 2
make: *** [Makefile:160: all] Error 2
{code}

What should I do to solve it?

johnynsk avatar Apr 21 '21 05:04 johnynsk