I am attempting to use Visual Studio 2019 to write my code for MATLAB mex files for it's ease of use, but am having a hard time getting rid of linking errors when building. When I compile in MATLAB using the mex command it compiles.
I have followed the instructions in MATLAB and here to add the appropriate header files location "***/R2023b/extern/include" and "lib" to project in properties-->C++-->General. I am also using one of the built in MATLAB mex examples in C++ (I am using mex.hpp not .h and mexAdapter.hpp).
Here is a typical error message I get when I attempt to build in Visual Studio, there are 26 other LINK2019 errors, am I just trying to do something that is not possible to do?
Severity Code Description Project File Line Suppression State Details
Error LNK2019 unresolved external symbol mex_engine_utf8_to_utf16 referenced in function "class std::basic_string<char16_t,struct std::char_traits<char16_t>,class std::allocator<char16_t> > __cdecl matlab::engine::convertUTF8StringToUTF16String(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?convertUTF8StringToUTF16String@engine@matlab@@YA?AV?$basic_string@_SU?$char_traits@_S@std@@V?$allocator@_S@2@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z) testMexFiles C:\Users\****\source\repos\testMexFiles\testMexFiles\testMex.obj 1