boost::interprocess - lnk2005 error due to compiler/linker bug in msvc8

when using boost::interprocess under win32, i ran into the following problem: in boost/interprocess/detail/win32_api.hpp several static inline functions have a function local class for releasing resources, like 'unlink_file', which defines 2 classes: handle_closer, and auto_ptr due to a compiler bug, as discussed here: http://www.eggheadcafe.com/conversation.aspx?messageid=32706692&threadid=32706692 you get a LNK2005 error <symbol> already defined in <object> when using boost::interprocess from multiple .cpp files a solution is to use boost::shared_ptr instead of local classes in win32_api.hpp, like this: boost::shared_ptr<void> hiPSAPI = boost::shared_ptr<void>(load_library("PSAPI.DLL"), free_library); attached is the complete patch willem

On Wed, 1 Jul 2009 10:03:12 +0200, willem hengeveld <itsme@xs4all.nl> wrote:
due to a compiler bug, as discussed here:
http://www.eggheadcafe.com/conversation.aspx?messageid=32706692&threadid=32706692 You can also pass the /force switch to the linker if you don't want to modify boost. -- EA

willem hengeveld escribió:
when using boost::interprocess under win32, i ran into the following problem: in boost/interprocess/detail/win32_api.hpp several static inline functions have a function local class for releasing resources, like 'unlink_file', which defines 2 classes: handle_closer, and auto_ptr
This should be fixed in SVN and boost 1.40. Best, Ion
participants (3)
-
Edouard A.
-
Ion Gaztañaga
-
willem hengeveld