LNK2019: unresolved external symbol __imp_runt​ime_create​_session

Hi Im trying to integrate MatlabCppSharedLib, I havent called any Matlab CPP API in the the code,
just the #include "MatlabCppSharedLib.hpp" and it throwing error
error LNK2019: unresolved external symbol __imp_runtime_create_session referenced in function "bool __cdecl `anonymous namespace'::init(class std::vector<class std::basic_string<char16_t,struct std::char_traits<char16_t>,class std::allocator<char16_t> >,class std::allocator<class std::basic_string<char16_t,struct std::char_traits<char16_t>,class std::allocator<char16_t> > > > const &)" (?init@?A0x1f98654b@@YA_NAEBV?$vector@V?$basic_string@_SU?$char_traits@_S@std@@V?$allocator@_S@2@@std@@V?$allocator@V?$basic_string@_SU?$char_traits@_S@std@@V?$allocator@_S@2@@std@@@2@@std@@@Z)
Have
  1. Added the lib folder path in Linker ->Input
  2. Copied libMatlabCppSharedLib.lib & libMatlabDataArray.lib & mclmcrrt.lib to the build folder
Kindly helpm thanks in advance

1 件のコメント

Jun Yang
Jun Yang 2022 年 9 月 8 日
Hi, I had a similar problem LNK2021 unresolved external symbol __imp_runtime_create_session.
I added: libMatlabCppSharedLib.lib, libMatlabDataArray.lib, mclmcrrt.lib, and my library specific *.lib generated by Matlab's application compiler to Linker | Input | Additional Dependencies (in a Microsoft VS 2017 c++ project). Rebuild it and there is no error any more.

サインインしてコメントする。

回答 (0 件)

カテゴリ

製品

リリース

R2021a

質問済み:

2021 年 4 月 29 日

コメント済み:

2022 年 9 月 8 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by