MATLAB Answers

Which files are compiled for external mode?

조회 수: 2(최근 30일)
I am trying to follow this example of how to communicate with the Arduino in external mode over Wifi, but the model won't compile. I get an error saying that a variable is undefined in a specific C file. Investigating the file I find that the variable is defined as "extern volatile boolean_T". There is a C++ file in which the variable is defined with the command "volatile boolean", but here's the problem: that file is not included in the long list of files in the report that comes along with the error. The list follows a pattern where every row starts with the path to either a C or C++ compiler, followed by a huge amount of arguments, and finishes with "filename.o" and "filename.c" (or cpp for the C++ compiler lines). "filename" is obviously different for each line, and the file that gives the error is found on one of the lines. The C++ file that actually defines the variable is not, and I believe this to be the problem.
My question is therefore where it is being set which files should be included when the code is generated? Looking at the "Code generation" pane in "Model configuration parameters" gives me no clue. To me it seems completely arbitrary, given that the actual model contains no block regarding the communication. It is possible to include custom code in "Model configuration parameters", but since this is a file that is actually part of the toolbox, I don't think that is the right way to go about it.
Note that I can get the model to compile (and run properly) when I set the communication option to Serial, so obviously the list of files that are included in the compilation is affected by at least some of the settings done in "Model configuration parameters".

  댓글 수: 0

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

채택된 답변

Biswa Dhal
Biswa Dhal 15 May 2017
편집: Biswa Dhal 15 May 2017

  댓글 수: 1

Rikard Ottemark
Rikard Ottemark 15 May 2017
Thank you for that information! Updating the support package solved the problem for me.

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

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by