Setup Google Test (gtest) with Eclipse on OS X

Posted by ejel on Stack Overflow See other posts from Stack Overflow or by ejel
Published on 2009-10-25T21:06:10Z Indexed on 2010/05/23 0:50 UTC
Read the original article Hit count: 859

Filed under:
|
|
|

What is the procedure to setup Google Test to work under Eclipse on Mac OS X? I followed the instruction in README to compile and install gtest as framework from XCode.

Now I want to use gtest with Eclipse. Currently, it compiles fine but fails during build. I suppose Eclipse does not use framework concept as XCode does and need a different linking approach, but I'm not sure which files should I link to during build.

g++ -L/usr/local/lib -L/usr/local/lib/libgtest.a -L/Library/Frameworks/gtest.framework -arch i386 -o "Raytracer"  ./test/sample_test.o  ./src/Raytracer.o   
Undefined symbols:
  "testing::Test::~Test()", referenced from:
      DemoTest_SANITY_Test::~DemoTest_SANITY_Test()in sample_test.o
      DemoTest_SANITY_Test::~DemoTest_SANITY_Test()in sample_test.o
  "testing::internal::AssertHelper::~AssertHelper()", referenced from:
      DemoTest_SANITY_Test::TestBody()      in sample_test.o
      DemoTest_SANITY_Test::TestBody()      in sample_test.o

© Stack Overflow or respective owner

Related posts about eclipse

Related posts about unit-testing