Visual Studio 2010 Matlab calling

1 次查看(过去 30 天)
Alina Badau
Alina Badau 2011-5-11
Hello,
I am working with Matlab Compiler 4.6 (Matlab R2007a). I am interested in calling a Matlab function from Microsoft Visual Studio 2010, C++ project. So far, I have created a simple function in Matlab, compiled it into a Shared C++ Library. After that, I have started and created in Visual Studio 2010, a C++ project (Win 32). Visual Studio is installed on a different computer, so I installed on this computer the MCRInstaller distributed with the deployment package previously and changed the VC++ include directories to C:\Program Files\MATLAB\MATLAB Component Runtime\v76\extern\include . So, I started creating a basic class and include "engine.h" and after that declare Engine *ep, in order to execute after that ep = engOpen(""); I have a first error < "Engine" undeclared identifier>
I want to know what I am doing wrong, what other settings I am supposed to consider and also if this is the best approach.
Please indicate me, if it's available, some good documentation for calling Matlab from C++ project in Visual Studio 2010.
Kind regards, Alina Badau

回答(1 个)

Saurabh Thakur
Saurabh Thakur 2011-5-11
When calling a MATLAB Compiler built C++ shared library you should use the procedure mentioned below
engOpen() is used to communicate with the MATLAB Engine i.e. a complete installation of MATLAB present on the system and not a compiled C++ shared library.

类别

Help CenterFile Exchange 中查找有关 Deploy to C++ Applications Using mwArray API (C++03) 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by