mcc compiler errors for -win32 and -R -nojvm
2 views (last 30 days)
Show older comments
Hello
I am using Matlab R2015a (x64 version) to compile my code to a DLL program. Some options set on the mcc compiler GUI produces the following errors:
Error: The option -win32 is invalid when executed from within MATLAB on "win64".
Error: The option -R is invalid in library or component mode (specify -? for help).
1) Howo can I compile my code as x32 DLL program?
2) How can I use -nojvm option for the DLL program?
Thank you.
Cem
ant:
<ant>
<mkdir dir="F:\user\Documents\Math\MATLAB\Work\ProgramV1.7\Program\for_redistribution" />
<mkdir dir="F:\user\Documents\Math\MATLAB\Work\ProgramV1.7\Program\for_testing" />
<mkdir dir="F:\user\Documents\Math\MATLAB\Work\ProgramV1.7\Program\for_redistribution_files_only" />
</ant>
mcc -win32 -R -nojvm -W cpplib:Program -T link:lib -d F:\user\Documents\Math\MATLAB\Work\ProgramV1.7\Program\for_testing -v F:\user\Documents\Math\MATLAB\Work\ProgramV1.7\Program.m -a F:\user\Documents\Math\MATLAB\Work\ProgramV1.7\get_metrics.m -a F:\user\Documents\Math\MATLAB\Work\ProgramV1.7\gridfit.m -a F:\user\Documents\Math\MATLAB\Work\ProgramV1.7\polygeom.m
Error: The option -win32 is invalid when executed from within MATLAB on "win64".
Error: The option -R is invalid in library or component mode (specify -? for help).
mcc failed.
0 Comments
Answers (1)
Walter Roberson
on 11 Dec 2020
If I recall correctly there was a way to compile for windows 32 from within 64 bit MATLAB, by exchanging compilation scripts. Unfortunately the documentation for that is no longer available to me.
The main way to proceed is to install the 32 bit version of MATLAB and use it to compile. That was still possible in your release.
3 Comments
Walter Roberson
on 11 Dec 2020
There used to be a command you could run to toggle between compiling for 32 bit and 64 bit for windows, and the -win32 or -win64 switch had some kind of meaning then.
The -R flag is documented as
Provide MATLAB Runtime options. This option is relevant only when building standalone applications using MATLAB Compiler.
but you are building a dll not a standalone executable.
The switch has to do with whether to link the java libraries into the final executable, and nothing to do with whether java is invoked by the code. For example there is nothing along the lines of
if user asked not to link java
emit this code into the executable
else
emit this other code into the executable
end
The closest you get to that is that in some places the code is
if usejava('jvm')
execute this code that invokes java
else
execute this other code
end
the calls to the java functions being built into the executable, but the code being able to detect that java is not in fact available right now.
usejava() invokes system_dependent() which is built-in, so we do not know exactly how it operates. It probably operates along similar lines to
try
make a java status call
catch ME
that failed, guess java is not running
end
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!