Error calling a DLL from MSVS C++ 2010
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Paul
el 3 de Nov. de 2014
Comentada: Paul
el 5 de Nov. de 2014
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 comentarios
Geoff Hayes
el 4 de Nov. de 2014
Or, it could be that this file, getNNXcounts.mexw64, is part of the MATLAB toolbox that came with R2014a.
Respuesta aceptada
Titus Edelhofer
el 4 de Nov. de 2014
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre MATLAB Compiler en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!