Ask Your Question

gtest is failing under fuerte [closed]

asked 2013-04-04 09:26:46 -0500

guitardude012 gravatar image

updated 2014-01-28 17:16:03 -0500

ngrennan gravatar image


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.


edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by joq
close date 2013-04-05 17:10:47


I tried to close this, but I don't have enough reputation.

guitardude012 gravatar image guitardude012  ( 2013-04-05 07:08:47 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-04-05 06:58:55 -0500

inflo gravatar image

hi, how do you run the test ? with "make test" , "make tests" or run the binary directly with e.g. test/bin/unit_tests ? Try run the test directly, what does this do?

edit flag offensive delete link more

Question Tools


Asked: 2013-04-04 09:26:46 -0500

Seen: 85 times

Last updated: Apr 05 '13