C++/VS2005: Defining the same class name in two different .cpp files
问题 Somewhat of an academic question, but I ran into this while writing some unit tests. My unit test framework (UnitTest++) allows you to create structs to serve as fixtures. Usually these are customized to the tests in the file, so I put them at the top of my unit test file. //Tests1.cpp struct MyFixture { MyFixture() { ... do some setup things ...} }; TEST_FIXTURE(MyFixture, SomeTest) { ... } //Tests2.cpp struct MyFixture { MyFixture() { ... do some other setup things, different from Tests1}};