MATLAB Answers

mick strife

MEX: Compiler lcc64 not supported in matlab64?

Asked by mick strife
on 1 May 2013


i want to use the compiler lcc(64-bit version) with matlab. As i ve read in this old link ( lcc is only supported in the 32-bit matlab version. As i ve mentioned the link is old but is there may be a chance to use lcc?

the reason behind this:

i m using matlab 32 on my laptop with lcc. when i compile my mex-file i ve no problems.

at work i have a 64 version with a different compiler. when i try to compile my mex-file i get errors like:

   cannot convert from 'const mxArray *' to 'mxArray *'

i guess that have something to do with the compiler?

Many thanks as always. i really appreciate this messageboard :)


1 Answer

Answer by Jan Simon
on 1 May 2013
 Accepted answer

When the error message appears with the modern compiler, but not with the old and buggy LCC compiler, this means, that the modern compiler is more accurate and cares about the const qualifier, while LCC ignores such details. Such facts and a bunch of cruel bugs are good reasons to use a modern compiler.

The new LCC64 version is an improvement already. It is possible to use it for Matlab, but not supported. This means that you have to adjust the mexopts.bat file manually. While this is possible and I've done this for new LCC32 versions, old WatcomC and Borland compilers also, it is not trivial. Sometimes everything works fine except for setting the -g flag for debugging, etc. It took me weeks to get a sufficiently working setup. And with the next Matlab version, new arrangements have been required.

Therefore I gave up and install the much more efficient MSVC compilers.

  1 Comment

thx for your advise, i really appreciate it :)

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!