How can I use the MATLAB Compiler to convert MATLAB code into a C/C++ source code on Windows and use the GNU compiler in Linux to generate a shared library?

I would like to do the following steps to generate a shared library that I can use in a Linux machine:
1.Run a MATLAB compile on our Windows system which will generate a C/C++
source file.
2. Take the generated source file and compile it with the GNU compiler on
our Linux system to produce the Linux shared library that we need.

 Accepted Answer

MATLAB compiler does not generate C/C++ source code for the MATLAB code. It only creates a wrapper file for the corresponding MATLAB files, which are platform dependent. The compilation process would use Windows specific compilers and header files to generate these wrapper files. Hence, when attempting to produce a shared library on Linux, the GNU compiler will not be compatible with the C/C++ wrapper files generated on Windows.
To read more about the compilation process, check the following link:

More Answers (0)

Categories

Products

Release

R2008a

Community Treasure Hunt

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

Start Hunting!