views:

39

answers:

0

Hello,

I'm working on Windows XP, VS2005. In addition I'm using log4cxx and it worked perfect for me. One day we decided to add Unicode support (UTF-8, cause we using utf-8 in our code base) to the logger. We found that we should change only two flags to make it work with unicode:

LOG4CXX_LOGCHAR_IS_UTF8 1 (instead of 0, in log4cxx.h)

LOG4CXX_CHARSET_UTF8 1 (instead of 0, in log4cxx_private.h)

Rebuilt log4cxx solution, and it works great (unicode issues are tested)

But, we have 3 projects in our solution that are not compiling anymore with this changes, and the errors we are getting is (for example Release/x64, but it's the same in all configurations):

log4cxx_x64.lib(log4cxx_x64.dll) : error LNK2005: "public: void __cdecl std::allocator,class std::allocator > ::destroy(class std::basic_string,class std::allocator > *)" (?destroy@?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@QEAAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z) already defined in someCppFile.obj

log4cxx_x64.lib(log4cxx_x64.dll) : error LNK2005: "public: void __cdecl std::allocator,class std::allocator >> >::deallocate(class std::basic_string,class std::allocator > *,unsigned __int64)" (?deallocate@?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@QEAAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_K@Z) already defined in someCppFile.obj

v:\Src\Solutions\....\Out\x64\Release\project.dll : fatal error LNK1169: one or more multiply defined symbols found

Already checked that Runtime library flag (C/C++ -> Code generation) is set to /MD in both our projects and log4cxx project. (that's was first suggestion)

I have no idea why only 3 specifically projects making problems (there is much more projects that are using log4cxx, and they are working)

If I set UTF8 flags back to "0", the problem resolved. (But I need Unicode support so it's not a solution for me)

Can you help me please? Thanks in advance!