protobuff和mysqlpp乘法定义符号,发现链接错误

时间:2017-03-27 03:02:16

标签: c++ protocol-buffers mysqlpp

1>mysqlpp_d.lib(mysqlpp_d.dll) : error LNK2005: "public: __cdecl std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >(int)" (??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z) already defined in libprotobufd.lib(common.obj)
1>mysqlpp_d.lib(mysqlpp_d.dll) : error LNK2005: "public: void __cdecl std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::`vbase destructor'(void)" (??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ) already defined in libprotobufd.lib(common.obj) 
fatal error LNK1169: one or more multiply defined symbols found

我的项目使用了最新的mysqlpp和protobuf3.0。我编译它们并将它们链接到我的项目静态中。我尝试使用MYSQLPP_NO_DLL编译mysqlpp并且没有定义MYSQLPP_NO_DLL,并更改libprotobufd.lib和mysqlpp_d.lib链接顺序。但vs2013总是告诉我多次定义的符号发现错误。你可以帮帮我吗?谢谢。

0 个答案:

没有答案