Menu

#212 Link error: duplicate __Named_exception methods

5.2
open
nobody
5
2009-08-05
2009-08-05
No

Linking multiple objects compiled with _STLP_USE_NO_IOSTREAMS with VC9 produces the errors like following:

error LNK2005: "public: __cdecl stlp_std::__Named_exception::__Named_exception(class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const &)" (??0__Named_exception@stlp_std@@QEAA@AEBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@1@@Z) already defined

Adding inline to all the __Named_exception methods in _stdexcept_base.c fixes the problem.
The problem is reproduced with STLPort 5.2.1. and does not with STLPort 5.1.7.

Discussion

  • Alexander Ivanisov

    suggested modification to stlport/stl/_stdexept_base.c

     
  • xander

    xander - 2009-09-02

    also in 5.2.0.
    reproed with VC2005, cygwin-g++ 3.4.4, and 4.3.2 on a fresh lenny.

    thanks for the tweak aivanisov; saved me plenty of hassle!

     

Log in to post a comment.