How to call MATLAB functions from Visual C++ 2010?

1 view (last 30 days)
Hi,
i want to call MATLAB functions from Visual C++ 2010, i followed steps on MathWorks.com, but it fails:
1. compile M-code into a C or C++ shared library using the MATLAB Compiler. Succeed.
2. reference compiled .lib under Visual C++ 2010. Succeed.
3. compile C++ with shared library from MATLAB. Failed.
Please help.
  3 Comments
Di Zhao
Di Zhao on 26 Sep 2012
Edited: Di Zhao on 26 Sep 2012
hi,
i follow the steps in VS 2010 professional and MATLAB R2012a: How do I create a C shared library with MATLAB Compiler 4.15 (R2011a) that can be used in Microsoft Visual Studio 2010 Express Edition?
but i get: 1>------ Rebuild All started: Project: template_vs2010, Configuration: Debug x64 ------ 1>Build started 9/26/2012 8:42:32 AM. 1>InitializeBuildStatus: 1> Creating "x64\Debug\template_vs2010.unsuccessfulbuild" because "AlwaysCreate" was specified. 1>ClCompile: 1> template.cpp 1>c:\program files\matlab\r2012a\extern\include\mclbase.h(157): error C2059: syntax error : 'string' 1>c:\program files\matlab\r2012a\extern\include\mclbase.h(181): error C2059: syntax error : 'string' 1> c:\program files\matlab\r2012a\extern\include\mclbase.h(185) : see reference to class template instantiation 'mclOutputHandlerAdapter<F>' being compiled 1> 1>Build FAILED. 1> 1>Time Elapsed 00:00:01.86 ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
would you help? thanks!
Kaustubha Govind
Kaustubha Govind on 26 Sep 2012
Di: Strange error. Could you try with one of the examples in the documentation to confirm that your compiler is installed/configured properly.

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!