Google Test not Linking with Program
<p>I'm having issues compiling my program with google test. I build the library using the direction on the site:</p>

<pre><code>g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \
-pthread -c ${GTEST_DIR}/src/gtest-all.cc
ar -rv libgtest.a gtest-all.o
</code></pre>

<p>I compiled my src using the following (unneeded builds are omitted):</p>

<pre><code>Building file: ../test/conv-gtest.cpp
Invoking: GCC C++ Compiler
g++ -I/data/alucard/include -I/home/jlahowetz2/Downloads/googletest-master/googletest/include -O2 -g -Wall -c -fmessage-length=0 --std=c++11 -isystem -pthread -MMD -MP -MF"test/conv-gtest.d" -MT"test/conv-gtest.d" -o "test/conv-gtest.o" "../test/conv-gtest.cpp"
Finished building: ../test/conv-gtest.cpp

Building target: alucard-dev
Invoking: GCC C++ Linker
g++ -L/data/alucard/lib -o "alucard-dev"  ./test/conv-gtest.o  ./src/CR1000.o ./src/FileReader.o   -lgtest
./test/conv-gtest.o: In function `__static_initialization_and_destruction_0':
/data/alucard/conv-gtest/../test/conv-gtest.cpp:26: undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
makefile:46: recipe for target 'alucard-dev' failed
/data/alucard/conv-gtest/../test/conv-gtest.cpp:35: undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
/data/alucard/lib/libgtest.a(gtest-all.o): In function `testing::internal::ThreadLocal&lt;testing::TestPartResultReporterInterface*&gt;::~ThreadLocal()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED5Ev]+0x16): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED5Ev]+0x2b): undefined reference to `pthread_key_delete'
/data/alucard/lib/libgtest.a(gtest-all.o): In function `testing::internal::ThreadLocal&lt;std::vector&lt;testing::internal::TraceInfo, std::allocator&lt;testing::internal::TraceInfo&gt; &gt; &gt;::~ThreadLocal()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED5Ev]+0x16): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED5Ev]+0x2b): undefined reference to `pthread_key_delete'
/data/alucard/lib/libgtest.a(gtest-all.o): In function `testing::internal::ThreadLocal&lt;std::vector&lt;testing::internal::TraceInfo, std::allocator&lt;testing::internal::TraceInfo&gt; &gt; &gt;::GetOrCreateValue() const':
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv]+0x18): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv]+0x7c): undefined reference to `pthread_setspecific'
/data/alucard/lib/libgtest.a(gtest-all.o): In function `testing::internal::ThreadLocal&lt;testing::TestPartResultReporterInterface*&gt;::CreateKey()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE9CreateKeyEv[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE9CreateKeyEv]+0x16): undefined reference to `pthread_key_create'
/data/alucard/lib/libgtest.a(gtest-all.o): In function `testing::internal::ThreadLocal&lt;std::vector&lt;testing::internal::TraceInfo, std::allocator&lt;testing::internal::TraceInfo&gt; &gt; &gt;::CreateKey()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE9CreateKeyEv[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE9CreateKeyEv]+0x16): undefined reference to `pthread_key_create'
/data/alucard/lib/libgtest.a(gtest-all.o): In function `testing::internal::ThreadLocal&lt;testing::TestPartResultReporterInterface*&gt;::GetOrCreateValue() const':
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv]+0x16): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv]+0x7a): undefined reference to `pthread_setspecific'
collect2: error: ld returned 1 exit status
make: *** [alucard-dev] Error 1

19:07:59 Build Finished (took 3s.341ms)
</code></pre>

<p>Here is the contents of conv-gtest.cpp:</p>

<pre><code>#include "gtest/gtest.h"

using namespace std;

class ConvTest : public ::testing::Test
{
protected:
  virtual void SetUp() {}
  virtual void TearDown() {}
};

TEST_F(ConvTest, selectConverter)
{
  EXPECT_TRUE(1);
};

int main(int argc, char **argv)
{
  ::testing::InitGoogleTest(&amp;argc, argv);
  return RUN_ALL_TESTS();
}
</code></pre>