mio icon indicating copy to clipboard operation
mio copied to clipboard

Including "mio/mmap.hpp" in more than one compilation unit

Open utilitydelta opened this issue 3 years ago • 3 comments

Hi,

I get this linker error if I have #include "mio/mmap.hpp" in more than one cpp file:

error LNK2005: "class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl mio::detail::win::s_2_ws(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?s_2_ws@win@detail@mio@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@@Z) already defined in test.obj

Any ideas on what I can do to fix? Running x64 build on Win11.

Thanks! Tyson

utilitydelta avatar Feb 03 '22 10:02 utilitydelta

See https://github.com/mandreyel/mio/pull/71

phprus avatar Feb 03 '22 10:02 phprus

thanks! nice one liner :)

utilitydelta avatar Feb 03 '22 11:02 utilitydelta