So I was able to create the .dll file in MATLAB 2013b with
mcc -B csharedlib:libmatrix solution.m
and had no problem calling this .dll file from Visual Studio C++ 2010.
However, since I re-compiled this same .dll in MATLAB 2014a with the exact same command, I got "Error using internal.optim.getNNZcounts" (see image below) when I called this .dll from my Visual Studio C++ 2010 project.
I am not sure what could have caused this error, as it worked totally fine when I compiled it with MATLAB 2013b which I no longer have a licence anymore. Any help or input would be appreciated.
Here are the codes for "solution.m" MATLAB file I used to compile the .dll with:
function [X,D] = solution(i,j,s,info,Y,LB,UB)
S = sparse(i,j,s,info(1),info(2),info(3));
X=quadprog(2*S'*S, -2*S'*Y,[],[],[],[],LB,UB,[],options);
D=S*X-Y;

댓글 수: 5

Geoff Hayes
Geoff Hayes 2014년 11월 3일
Paul - does the file getNNXcounts.mexw64 exist in the specified folder? If so, was it compiled with 2013b or 2014a?
Paul
Paul 2014년 11월 4일
Yes, it's there. I think it could possibly be compiled with MATLAB 2013b, but not 100% sure. Could this be the cause? If it is, can I just replace it with that compiled with MATLAB 2014a?
Geoff Hayes
Geoff Hayes 2014년 11월 4일
It could be, though I'm not sure how you would force a recompile of that file only. (I don't have the mcc app.) You could just move the file to another directory and try the build again and see if R2014a creates it. Though maybe this would have to be done for other files to. Is there any way for you to find out if this file was built with 2013b? Is the file creation and/or modified date recent (since your MATLAB upgrade)?
Paul
Paul 2014년 11월 4일
I checked the dates and stuff, and it does seem that it's from MATLAB 2013b. When I move the getNNXcounts.mexw64 file out of the "+optim" folder, I get an error that says that file cannot be found. I did the same to the "libmat12" folder, however, and MATLAB simply re-creates the folder.
Geoff Hayes
Geoff Hayes 2014년 11월 4일
Or, it could be that this file, getNNXcounts.mexw64, is part of the MATLAB toolbox that came with R2014a.

댓글을 달려면 로그인하십시오.

 채택된 답변

Titus Edelhofer
Titus Edelhofer 2014년 11월 4일

0 개 추천

Hi,
it looks indeed as from R2013b: the folder mcrCache8.2 tells you it relates to MCR version 8.2 of the MATLAB compiler, and that's indeed R2013b.
So I'd suggest to compile (again) with R2014a. And when you run the code, to be on the safe side, add the matlabroot\runtime\win64 and matlabroot\bin\win64 folders to your (DOS-)PATH at the beginning.
Titus

댓글 수: 4

Out of curiosity, how will Paul force a rebuild of those R2013b MEX files? Since he has already tried
mcc -B csharedlib:libmatrix solution.m
and that didn't rebuild getNNXcounts.mexw64, what command would?
Titus Edelhofer
Titus Edelhofer 2014년 11월 4일
Hi Geoff,
the mex files are part of the MATLAB installation and will be added while executing the mcc command. During compilation mcc will grab from matlabroot\toolbox\optim\optim\+internal\+optim the mex file, where matlabroot is always the one, where you compile ...
Titus
Geoff Hayes
Geoff Hayes 2014년 11월 4일
Thanks Titus!
Paul
Paul 2014년 11월 5일
Thanks Titus and Geoff. I will give that a try when I can.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

질문:

2014년 11월 3일

댓글:

2014년 11월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by