Can I compile C++ MEX-files, ENGINE programs, or MAT-file programs using MATLAB?

I would like to have the ability to compile C++ MEX-files, ENGINE programs, or MAT-file programs using MATLAB.

 채택된 답변

As of MATLAB 7.0 (R14), MEX should handle C++ MEX-files, Engine programs, or MAT-file programs. If you are using a previous version of MATLAB, please see the following:
We have not officially tested the use of C++ MEX, ENGINE, or MAT-files. It appears that in most cases for MATLAB 5.3 and higher, C++ is compatible. However, there are some known platform, compiler, and code dependent issues.
To compile C++ MEX-files, ENGINE programs, or MAT-file programs, you must let your C Compiler know that you are compiling a C++ file. If you are compiling with the 'mex' command and using our options files, you would need to add the following to your COMPFLAGS option in your options file:
-DNO_BUILT_IN_SUPPORT_FOR_BOOL
If you are compiling in the IDE, you must be sure to add the pre-processor directive:
NO_BUILT_IN_SUPPORT_FOR_BOOL
to the CFLAGS as part of the pre-processor directive field of the IDE for your particular C compiler.
For more information regarding C++ MEX-files, see Technical Note 1605: MEX-files Guide.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by