c++.stlsoft - Use of auto_buffer in Pantheios to avoid VC++ 8/9 link bug
- Matthew Wilson (27/27) Apr 15 2008 charset="iso-8859-1"
charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable There is a strange code-generation bug with VC++ 8 & 9 in DLL = compilation mode (/MD, /MDd), whereby the linker complains of multiple = instances of std::allocator<>::allocate() and = std::allocator<>::deallocate(). This has seemed to manifest with sues of = stlsoft::auto_buffer.=20 The workaround to this is to #include = <pantheios/util/memory/auto_buffer_selector.hpp> rather than = <stlsoft/memory/auto_buffer.hpp>, and then derive the required = specialisation via the generator template. For example, where you might formerly have done #include <stlsoft/memory/auto_buffer.hpp> . . . stlsoft::auto_buffer<char, 200> buff(10); you would now do #include <pantheios/util/memory/auto_buffer_selector.hpp> . . . pantheios::auto_buffer_selector<char, 200>::type buff(10); In using the latter form another allocator type - = stlsoft::malloc_allocator - will be used, and the multiple symbols = problem will be avoided. The next version of STLSoft - 1.9.32 - will also contain an analogous = workaround, which will then be automatically propagated to all other = dependent libraries (the bug's also been seen in shwild). Cheers Matt
Apr 15 2008