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

1 Ansicht (letzte 30 Tage)
I would like to have the ability to compile C++ MEX-files, ENGINE programs, or MAT-file programs using MATLAB.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 27 Jun. 2009
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.

Weitere Antworten (0)

Kategorien

Mehr zu Call C++ from MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by