필터 지우기
필터 지우기

mcc compiler errors for -win32 and -R -nojvm

조회 수: 3 (최근 30일)
Cem
Cem 2020년 12월 11일
댓글: Cem 2020년 12월 12일
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.

답변 (1개)

Walter Roberson
Walter Roberson 2020년 12월 11일
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
Walter Roberson
Walter Roberson 2020년 12월 11일
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
Cem
Cem 2020년 12월 12일
Great answer. Thank you.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Java Package Integration에 대해 자세히 알아보기

태그

제품


릴리스

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by