필터 지우기
필터 지우기

How to avoid code error when compile stand alone utility

조회 수: 4 (최근 30일)
Mark Golberg
Mark Golberg 2022년 5월 25일
답변: Image Analyst 2022년 5월 25일
Hello,
I'm trying to compile a Stand Alone Utility.
Source code is based on folders tree with many layers and functions (it's a ~ 10 years legacy code).
I receive error in "deploytool" for trying to compile functions with Matlab error inside. I've tried to fix the errors manually, one by one, but there are just too many.
Is there an automated process, in which I could simple check something like "ignore files with code error"?
I know for 100% my GUI won't be using those files with error code, that's why I don't afraind to remove them entirely from my compilation.
I'm familiar with the function "checkcode". But in order to use it, I have to run over ALL the "milion" files in my GUI, and I'm trying to avoid that.
  댓글 수: 2
Benjamin Thompson
Benjamin Thompson 2022년 5월 25일
Please post the code, and which C compiler you have configured with MEX to compile the code, and a list of the output errors. Otherwise we cannot reproduce your problem and do not know what errors you are having.
Mark Golberg
Mark Golberg 2022년 5월 25일
Thank you.
  1. I'm not compling for C, MEX, etc... I'm compiling MATLAB GUIDE to a Stand Alone executable.
  2. Imagine your GUI is build on 1000 functions, spread over 100 folders... (like I said, it's an very old and cumbersome legacy code). Some of these function have "silly" errors like
a =
I can go one-by-one, and simply comment out these probalamatic lines.
BUT, it's a very tedious and time consuming process.
I'm asking, if MATLAB can somehow ignore all the files with errors inside, and simply create my utility + log file near by, saying something like: "here's is your exe file... but, pay attention, the following file couldn't been compiled..."
I hope it's clearer this time :)

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

답변 (1개)

Image Analyst
Image Analyst 2022년 5월 25일
With lots of silly errors, are you even able to run it in the MATLAB IDE? If so, can you simply use
>> mcc -m yourMainFile.m
to compile your app? If not, what does it say? It shouldn't matter if there are hundreds of functions being called as long as they are all on the path -- it will find them. Sometimes the code will only throw an error during run-time so of course the compiler won't know or care about those lines of code. However if there is a syntax error in your main program, it won't compile. Not sure if syntax errors in dependent m-files will be caught during the compile process or not.
I compile standalone apps built with GUIDE every day.
Compiler FAQ:

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by