Новый проект компилируется без проблем. >
НО, как только я включаю std::string внутри одной функции, я получаю странные ошибки компоновщика.
Я могу не верю, что я единственный, кто пытается использовать std::string в проекте CLR?
Цель этого проекта — связать существующий модуль C++ с C#.
Использование Visual Studio 2022.
Это журнал ошибок:
Код: Выделить всё
1>ClassLibrary1.cpp
1>AssemblyInfo.obj : MSIL module encountered; incremental linking is disabled for MSIL; performing full link
1>MSVCRTD.lib(throw_bad_alloc.obj) : error LNK2005: "public: __cdecl std::bad_alloc::bad_alloc(class std::bad_alloc const &)" (??0bad_alloc@std@@QEAA@AEBV01@@Z) already defined in abseil_dll.lib(abseil_dll.dll)
1>MSVCRTD.lib(throw_bad_alloc.obj) : error LNK2005: "public: __cdecl std::bad_array_new_length::bad_array_new_length(class std::bad_array_new_length const &)" (??0bad_array_new_length@std@@QEAA@AEBV01@@Z) already defined in abseil_dll.lib(abseil_dll.dll)
1>MSVCRTD.lib(throw_bad_alloc.obj) : error LNK2005: "public: __cdecl std::exception::exception(class std::exception const &)" (??0exception@std@@QEAA@AEBV01@@Z) already defined in abseil_dll.lib(abseil_dll.dll)
1>MSVCRTD.lib(throw_bad_alloc.obj) : error LNK2005: "public: virtual __cdecl std::bad_array_new_length::~bad_array_new_length(void)" (??1bad_array_new_length@std@@UEAA@XZ) already defined in abseil_dll.lib(abseil_dll.dll)
1>MSVCRTD.lib(throw_bad_alloc.obj) : error LNK2005: "public: virtual char const * __cdecl std::exception::what(void)const " (?what@exception@std@@UEBAPEBDXZ) already defined in abseil_dll.lib(abseil_dll.dll)
1>C:\Work\StlClr Sample\ClassLibrary1\x64\Debug\ClassLibrary1.dll : fatal error LNK1169: one or more multiply defined symbols found
Подробнее здесь: https://stackoverflow.com/questions/790 ... already-in