how to integrate matlab generated dll into visual studio /C++
Mostrar comentarios más antiguos
We have a simple matlab script myscript.m that performs simple math functions that does not use matlab library function.
Converting myscript.m into c++ using the command line resulted generating myscript.dll. >> mcc -W cppli b:liba -T link:lib myscript.m
When we try to integrate this myscript.dll into visual studio VC++ project, we get the following errors.
testmyscript.obj : error LNK2019: unresolved external symbol _mxGetPi_proxy referenced in function _wmain testmyscript.obj : error LNK2019: unresolved external symbol _mxGetPr_proxy referenced in function _wmain testmyscript.obj : error LNK2019: unresolved external symbol _mxCreateDoubleMatrix_730_proxy referenced in function _wmain
The test project testmyscript is using following functions, the VC++ compliler is unable to resolve external symbols.
plhs = mxCreateDoubleMatrix(rows, cols, mxCOMPLEX); start_of_pr = (double *)mxGetPr(plhs); memcpy(start_of_pr, pr_data, rows * cols * sizeof(double) );
Can you suggest how to the fix the problem. This is experimental code may not answer why?
Need help with steps integrate mathlab generated dll onto visual c++ (VS) environment.
SW Version used: VS2010, Matlab R2012b Configured path for mathlab header files and libraries under visual studio.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre C Shared Library Integration en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!