# Revision history [back]

### gtest is failing under fuerte

Hi,

When attempting to perform a "make test" using gtest and an EXPECT_* macro I get:

undefined reference to testing::internal::AssertHelper::AssertHelper(testing::TestPartResultType, char const, int, char const)'

otherwise, if I comment those checks out then the tests run.

When searching google, it seems that this can happen when trying to use a pre-installed version of gtest. I believe the source is being used in /usr/src/gtest however.

I am using rosbuild_add_gtest(unit_tests test/unit_tests.cpp) to specify compilation in CMakeLists.txt

Any ideas?

Thanks

### gtest is failing under fuerte

Hi,

When attempting to perform a "make test" using gtest and an EXPECT_* macro I get:

undefined reference to testing::internal::AssertHelper::AssertHelper(testing::TestPartResultType, char const, int, char const)'

otherwise, if I comment those checks out then the tests run.

When searching google, it seems that this can happen when trying to use a pre-installed version of gtest. I believe the source is being used in /usr/src/gtest however.

I am using rosbuild_add_gtest(unit_tests test/unit_tests.cpp) to specify compilation in CMakeLists.txt

Any ideas?

Edit: I tried compiling the test by hand with g++. I figured out that somehow I had ended up with a mismatch between the /usr/src/gtest and /usr/include/gtest. I replaced the /usr/include/gtest folder /usr/src/gtest/include/gtest folder and it works now. For anyone that experiences a similar problem, it is still more likely to be that gtest was pre-compiled with the wrong flags, or you are accidentally linking against a pre-compiled library in /usr/lib.

Thanks

 3 retagged

### gtest is failing under fuerte

Hi,

When attempting to perform a "make test" using gtest and an EXPECT_* macro I get:

undefined reference to `testing::internal::AssertHelper::AssertHelper(testing::TestPartResultType, char const, int, char const)'

otherwise, if I comment those checks out then the tests run.

When searching google, it seems that this can happen when trying to use a pre-installed version of gtest. I believe the source is being used in /usr/src/gtest however.

I am using rosbuild_add_gtest(unit_tests test/unit_tests.cpp) to specify compilation in CMakeLists.txt

Any ideas?

Edit: I tried compiling the test by hand with g++. I figured out that somehow I had ended up with a mismatch between the /usr/src/gtest and /usr/include/gtest. I replaced the /usr/include/gtest folder /usr/src/gtest/include/gtest folder and it works now. For anyone that experiences a similar problem, it is still more likely to be that gtest was pre-compiled with the wrong flags, or you are accidentally linking against a pre-compiled library in /usr/lib.

Thanks