[xsd-users] XSD & Windows DLL linkage issues with std::string
Nicolas Weidmann
n.weidmann at lombardodier.com
Wed Jun 17 03:57:37 EDT 2026
Hello,
I am new to XSD, so be indulgent… 😉
I am encountering linking issues in the following configuration when creating a Windows DLL for my data-binding:
* XSD 4.2.0
* Visual Studio 2017, v141 & C++17
* CMake 3.30.2
I can create my DLL and test it without any issues.
However as soon as I use my data-binding in another library that is also to be generated as a DLL, I get link errors regarding std::string:
data-binding.lib(data-binding.dll) : error LNK2005: "public: __cdecl std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<cha
r> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QEAA at AEBV01@@Z) already defined in ClassUsingTheDataBinding.obj [LibraryUsingTheDatabinding.vcxproj]
I get this issue for every constructor and method of std::string used in the “client” library.
Since I include some XSD library headers directly, I have XSD_CXX11 globally defined for both projects.
Has someone already encountered a similar issue?
Regards,
Nicolas Weidmann
Banque Lombard Odier & Cie SA
Rue de la Corraterie 11 - 1204 Genève - Suisse
T +41 22 709 23 17
www.lombardodier.com
[[ rethink everything. ]]<https://www.lombardodier.com>
[[LinkedIn]]<https://www.linkedin.com/company/lombard-odier> [[Twitter]] <https://twitter.com/lombardodier> [[Facebook]] <https://facebook.com/lombardodier> [[Instagram]] <https://www.instagram.com/lombardodier/> [[YouTube]] <https://www.youtube.com/channel/UCqatbeqXskmWejbm0KPLV3w>
*** IMPORTANT NOTICE REGARDING INSTRUCTIONS by EMAIL ***
Please be aware that instructions received by e-mail should be
considered delayed and not executed unless they have been
specifically confirmed by your relationship manager/banker.
Email traffic during turbulent times in the financial markets is
high and cannot always be acted upon at all times.
Lombard Odier cannot be held liable for such delay in execution
or for the non-execution of an instruction given by email even
if it was given in due time. Therefore, instructions requiring
immediate action must be communicated by telephone by calling
the bank’s registered landline.
Thank you for your understanding.
*** IMPORTANT INFORMATION ABOUT DATA PROTECTION ***
You might be receiving this because you have provided us with
your contact details. If this is the case note that we may process
your personal data for direct marketing purposes.
If you wish to object to this processing, please notify the
Group’s Data Protection Officer<mailto:group-dataprotection at lombardodier.com>.
For more information: www.lombardodier.com/privacy-policy
DISCLAIMER **********************************************
This message is intended only for use by the person
to whom it is addressed. It may contain information
that is privileged and confidential. Its content does
not constitute a formal commitment by any company
of the Lombard Odier group. If you are not the intended
recipient of this message, kindly notify the sender
immediately and destroy this message. Thank You.
*******************************************************(dch)*
More information about the xsd-users
mailing list