how to integrate matlab generated dll into visual studio /C++
이전 댓글 표시
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!