Use of matlab generated dll in VisualStudio C++
Show older comments
We want to use matlab generated dll in VisualStudio.
First System: Windows7 64bit, MatlabR2012b 32bit with Matlab Compiler
Second System: WindowsXP 32 bit, Matlab Runtime R2012b 32bit (MCR 8.0), Microsoft VisualStudio 2008
First we try the matlab example in extern/examples/compiler and the Help description in Matlab Compiler-> Shared Libraries ->Integrate CShared Libraries
1. We get addmatrix.m, multiplymatrix.m, eigmatrix.m
2. On first system the matlab compiler generates a “C Shared Library” (NOT C++ shared lib) and we get libmatrix.h, libmatrix.lib and libmatrix.dll
3. On the second system we create a new project in VisualStudio. We have only one C-source from the example matrixdriver.c
The project properties we set: Additional include to find libmatrix.h
Linker additional dependancies: libmatrix.lib, mclmcrrt.lib
Additional library path: to find libmatrix.dll and C:\Programme\Matlab\Matlab Compiler Runtime\extern\lib\win32\microsoft
4. libmatrix.dll is set in the same path as matrixdriver.exe The path to the matalb-dlls was set automatically in the environment variable “path” with the installation of MCR.
The compilation and linking works fine but the execution results in a runtime error.
3 Comments
Kaustubha Govind
on 13 May 2013
Please specify what the runtime error message says.
Monika
on 14 May 2013
Monika
on 17 May 2013
Answers (0)
Categories
Find more on C Shared Library Integration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!