Boost logo

Boost :

Subject: Re: [boost] Static Libraries / Multiply Defined Symbols
From: k-oli_at_[hidden]
Date: 2009-07-22 13:30:40


Did you define in stdafx.h?

#define BOOST_INTERPROCESS_USE_DLL
#define BOOST_LIB_DIAGNOSTIC // prints the libs linked

Maybe you have to do this for other boost-libs too.

Oliver

Am Mittwoch 22 Juli 2009 17:38:43 schrieb Audino, Jeremy:
> Using Visual Studio 2005, I have two independent static libraries making
> use of boost. When linking both into an executable I'm getting some
> multiply defined symbols. I suspect that since most of boost's
> implementation is header-only, symbols for the boost library functions are
> appearing in both libraries. I can get around this by specifying
> /FORCE:MULTIPLE when linking, but this isn't ideal. Is there a better way
> to get around this?
>
> Best Regards,
> Jeremy
>
> libNMRSD.lib(NMRSModule.obj) : error LNK2005: "public: __thiscall `bool
> __cdecl
> boost::interprocess::winapi::get_file_name_from_handle_function(void
> *,wchar_t *,unsigned int,unsigned int
> &)'::`7'::library_unloader::library_unloader(void *)"
> (??0library_unloader@?6??get_file_name_from_handle_function_at_winapi@interpro
>cess_at_boost@@YA_NPAXPA_WIAAI_at_Z@QAE_at_0@Z) already defined in
> libDICOMTOOLSD.lib(Log.obj) libNMRSD.lib(NMRSModule.obj) : error LNK2005:
> "public: __thiscall `bool __cdecl
> boost::interprocess::winapi::get_file_name_from_handle_function(void
> *,wchar_t *,unsigned int,unsigned int
> &)'::`7'::library_unloader::~library_unloader(void)"
> (??1library_unloader@?6??get_file_name_from_handle_function_at_winapi@interpro
>cess_at_boost@@YA_NPAXPA_WIAAI_at_Z@QAE_at_XZ) already defined in
> libDICOMTOOLSD.lib(Log.obj) libNMRSD.lib(NMRSModule.obj) : error LNK2005:
> "public: __thiscall `bool __cdecl
> boost::interprocess::winapi::unlink_file(char const
> *)'::`9'::handle_closer::handle_closer(void *)"
> (??0handle_closer@?8??unlink_file_at_winapi@interprocess_at_boost@@YA_NPBD_at_Z@QAE@
>PAX_at_Z) already defined in libDICOMTOOLSD.lib(Log.obj)
> libNMRSD.lib(NMRSModule.obj) : error LNK2005: "public: __thiscall `bool
> __cdecl boost::interprocess::winapi::unlink_file(char const
> *)'::`9'::handle_closer::~handle_closer(void)"
> (??1handle_closer@?8??unlink_file_at_winapi@interprocess_at_boost@@YA_NPBD_at_Z@QAE@
>XZ) already defined in libDICOMTOOLSD.lib(Log.obj)
> libNMRSD.lib(NMRSModule.obj) : error LNK2005: "public: __thiscall `bool
> __cdecl boost::interprocess::winapi::unlink_file(char const
> *)'::`11'::auto_ptr::auto_ptr(union `bool __cdecl
> boost::interprocess::winapi::unlink_file(char const *)'::`10'::mem_t *)"
> (??0auto_ptr@?L@??unlink_file_at_winapi@interprocess_at_boost@@YA_NPBD_at_Z@QAE_at_PATm
>em_t@?9??1234_at_YA_N0_at_Z@@Z) already defined in libDICOMTOOLSD.lib(Log.obj)
> libNMRSD.lib(NMRSModule.obj) : error LNK2005: "public: __thiscall `bool
> __cdecl boost::interprocess::winapi::unlink_file(char const
> *)'::`11'::auto_ptr::~auto_ptr(void)"
> (??1auto_ptr@?L@??unlink_file_at_winapi@interprocess_at_boost@@YA_NPBD_at_Z@QAE_at_XZ)
> already defined in libDICOMTOOLSD.lib(Log.obj) libNMRSD.lib(NMRSModule.obj)
> : error LNK2005: "public: union `bool __cdecl
> boost::interprocess::winapi::unlink_file(char const *)'::`10'::mem_t *
> __thiscall `bool __cdecl boost::interprocess::winapi::unlink_file(char
> const *)'::`11'::auto_ptr::get(void)const "
> (?get_at_auto_ptr@?L@??unlink_file_at_winapi@interprocess_at_boost@@YA_NPBD_at_Z@QBEPAT
>mem_t@?9??2345_at_YA_N0_at_Z@XZ) already defined in libDICOMTOOLSD.lib(Log.obj)
> libNMRSD.lib(NMRSModule.obj) : error LNK2005: "public: union `bool __cdecl
> boost::interprocess::winapi::unlink_file(char const *)'::`10'::mem_t *
> __thiscall `bool __cdecl boost::interprocess::winapi::unlink_file(char
> const *)'::`11'::auto_ptr::operator->(void)const "
> (??Cauto_ptr@?L@??unlink_file_at_winapi@interprocess_at_boost@@YA_NPBD_at_Z@QBEPATme
>m_t@?9??1234_at_YA_N0_at_Z@XZ) already defined in libDICOMTOOLSD.lib(Log.obj)
> C:\home\jaudino\src\prs-removal\bin\translatorD.exe : fatal error LNK1169:
> one or more multiply defined symbols found
>
> Jeremy F. Audino
> Senior Software Development Engineer
> Philips Healthcare -- Nuclear Medicine
> Tel: 440-483-7444
> E-mail: jeremy.audino_at_[hidden]
>
>
> ________________________________
> The information contained in this message may be confidential and legally
> protected under applicable law. The message is intended solely for the
> addressee(s). If you are not the intended recipient, you are hereby
> notified that any use, forwarding, dissemination, or reproduction of this
> message is strictly prohibited and may be unlawful. If you are not the
> intended recipient, please contact the sender by return e-mail and destroy
> all copies of the original message.
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk