フィルターのクリア

Shared library initialization error with Matlab2015b and VS2015

2 ビュー (過去 30 日間)
Kanda muruganandam
Kanda muruganandam 2018 年 10 月 11 日
コメント済み: Kanda muruganandam 2018 年 10 月 19 日
I created a shared library using the following command mex -setup mcc -vg -W -win32 lib:libTest -T link:lib NumberToAlphabet
Program to initialize the shared library below.
if true
% code
end
class MatLabInit
{
public:
MatLabInit()
{
const char *args[] = { "-nojvm" };
const int count = sizeof(args) / sizeof(args[0]);
if (mclInitializeApplication(0, NULL) == false) {
MessageBox(NULL,_T("Could not initialize the application properly."),_T("Error"), MB_OK);
return;
}
if (libTestInitialize() == false) {
MessageBox(NULL, _T("Could not initialize libtest."),_T("Error"), MB_OK);
return;
}
}
~MatLabInit()
{
libTestTerminate();
mclTerminateApplication();
}
};
It could not initialize the shared library.
Could you please help me solve this.

回答 (1 件)

Vineet Ahirkar
Vineet Ahirkar 2018 年 10 月 15 日
The error "Could not initialize shared library" commonly occurs when the "MCR_CACHE_ROOT" environment variable is not set.
To set this environment variable from MATLAB use the "setenv" function as follows -
% sample - setenv('VARIABLE_NAME','VALUE');
>> setenv('MCR_CACHE_ROOT','C:\TEMP');
For more information related to setting "MCR_CACHE_ROOT" please refer to the link below - 
  1 件のコメント
Kanda muruganandam
Kanda muruganandam 2018 年 10 月 19 日
It didn't solve the issue. Initializing shared library still failed.

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

カテゴリ

Help Center および File ExchangeC Shared Library Integration についてさらに検索

タグ

製品


リリース

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by