I want to include a TestSuite inside my shared DLL. However, when adding a class which inherits from TestCase, I get many linking errors of the form
msvcprtd.lib(MSVCP70D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) already defined in ProcessorRequest.obj
Those errors are preventing me from exporting a GetTestSuite(TestSuite*) function that will allow me to test all my DLLs.
I don't have enough experience with Visual C++ to find out what the problem is. I know it's a template instantiation issue but I can't seem to resolve it. I tried to ignore the msvcprtd library but it didn't work.
Phil
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You were right Baptiste, there was a conflict in the run-time libraries. Most were using the static versions, but one of them was using the shared version.
Hard to find when there is a lot of projects involved.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to include a TestSuite inside my shared DLL. However, when adding a class which inherits from TestCase, I get many linking errors of the form
msvcprtd.lib(MSVCP70D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) already defined in ProcessorRequest.obj
Those errors are preventing me from exporting a GetTestSuite(TestSuite*) function that will allow me to test all my DLLs.
I don't have enough experience with Visual C++ to find out what the problem is. I know it's a template instantiation issue but I can't seem to resolve it. I tried to ignore the msvcprtd library but it didn't work.
Phil
If I understand you correctly you should mark your function with __declspec(dllexport)
Please check the source files for that.
Are you using the modified H files?
Your are probably not using the same run-time libraries. Check the C++/code-genereation tab in the project settings.
What you want to do is done in:
cppunit\examples\msvc6\TestPlugIn
Baptiste.
You were right Baptiste, there was a conflict in the run-time libraries. Most were using the static versions, but one of them was using the shared version.
Hard to find when there is a lot of projects involved.