Alex Luya
Alex Luya

Reputation: 9912

Eclipse+gtest compile c++ error:multiple definition of "...."

I have project like this: enter image description here

When I try to compile this,get error:multipe definition of `FooTest_failing_Test:TestBody()'

I have compiled gtest 1.7 and gmock 1.7,and copied all libg* to /user/lib,and my build setting like this: enter image description here

enter image description here

enter code here

Upvotes: 0

Views: 2261

Answers (1)

TimDave
TimDave

Reputation: 652

FootTest.cpp is being compiled twice because it is being #include(d) in AllTests.cpp. This produces the symbol twice that you are seeing. I don't think you need to include FooTest.cpp in AllTests.cpp.

Upvotes: 3

Related Questions