Problem in using engOpenSingleUse()

1 回表示 (過去 30 日間)
Amateuromania
Amateuromania 2012 年 10 月 9 日
I've used the C++ interface of matlab on Windows. I keep getting the error messages after I have made 3 calls to matlab using engOpenSingleUse(). Every call is terminated by closing function.
"Internal Error: A primary message table for module 77 was already registered with a differing collection of error messages.Severe: The program '[4484] d:\...\a.exe: Native' has exited with code 1 (0x1)."
After the code exits, however the matlab command window is opened. P.S: I have tried using engOpen() instead, but the problem persists.
Can anyone tell me what can I do to fix it?
Thanks a lot!

回答 (1 件)

Friedrich
Friedrich 2012 年 10 月 9 日
編集済み: Friedrich 2012 年 10 月 9 日
Hi,
I used the following code to open ML four times but it works fine:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "engine.h"
int main()
{
Engine *ep;
int retstatus,i;
char ch;
for(i=1;i<=4;i++){
ep = engOpenSingleUse(NULL,NULL,&retstatus);
if (retstatus != 0) {
fprintf(stderr, "\nCan't start MATLAB engine\n");
return EXIT_FAILURE;
}
if (engSetVisible(ep,1) != 0){
fprintf(stderr, "\nCan't make MATLAB engine visible\n");
return EXIT_FAILURE;
}
printf("Press any key to exit\n");
ch = getchar();
engClose(ep);
}
return EXIT_SUCCESS;
}
I can also open 4 MATLABs at the same time without any problem (tested in 12b 64bit Win 7).
Can you post a small reproduction code which raises the error you get?
  1 件のコメント
Friedrich
Friedrich 2012 年 10 月 9 日
And I compiled this code with:
mex('-v', '-f', fullfile(matlabroot,...
'bin','win64','mexopts','mssdk71engmatopts.bat'),...
'engsingleusedemo.c');

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

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by