On 03/10/2013 11:33, Anton Simakov wrote: > Hi! > > I'm trying to use Boost.Log 2.0 in my project which is based on Open Babel. > I'm currently compiling at Windows with Visual C++ 2010 and linkage > fails with the following message > > libboost_log-vc100-mt-gd-1_54.lib(exceptions.obj) : error LNK2005: > "public: virtual __thiscall std::basic_stringbuf<char,struct > std::char_traits<char>,class std::allocator<char> > >::~basic_stringbuf<char,struct std::char_traits<char>,class > std::allocator<char> >(void)" > (??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ) > already defined in openbabel-2.lib(openbabel-2.dll) > > libboost_log-vc100-mt-gd-1_54.lib(exceptions.obj) : error LNK2005: > "public: __thiscall std::basic_stringbuf<char,struct > std::char_traits<char>,class std::allocator<char> > >::basic_stringbuf<char,struct std::char_traits<char>,class > std::allocator<char> >(int)" > (??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z) > already defined in openbabel-2.lib(openbabel-2.dll) > > fatal error LNK1169: one or more multiply defined symbols found > > Seems like both openbabel-2.dll and libboost_log-vc100-mt-gd-1_54.lib > exporting same symbols. > Boost binaries are from official sourceforge.net > <http://sourceforge.net> page and openbabel-2.dll was built by myself, > but the same symbols are exported by openbabel-2.dll from official binaries. > > Does anyone knows how to fix that?
I have had this sort of problem in the past with wxWidgets rather than Boost but I think it was still with std::basic_stringbuf. I don't know how to solve it, but the following may help. Check that the DLLs are both built using the same compiler and are using the same runtime libraries. A final workaround is to set the option "Multiply Defined Symbol Only (/FORCE:MULTIPLE)" in Linker/General/Force File Output. This is said to be dangerous but has been ok when I used it. The problem is described in several sites on the web but for the ones I found it was not very clearly defined and was without a general solution. Chris ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk _______________________________________________ OpenBabel-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
