필터 지우기
필터 지우기

Missing variable definition in .h

조회 수: 5 (최근 30일)
oussama
oussama 2023년 6월 26일
편집: oussama 2023년 7월 10일
Hello,
I am currently generating a .c code from a .slx (AUTOSAR model). The issue I'm facing is that all the variables used in .c file are defined in the .h file, except for two variables: SWC_NAME_VAR_INIT and SWC_NAME_CODE. This problem is causing errors during the building phase.I'm wondering why these variables are not defined in the .h file and how can I configure Simulink to resolve this issue ?.
This is the content of model_name.c file :

답변 (1개)

Aniketh
Aniketh 2023년 7월 6일
It is possible that the variables SWC_NAME_VAR_INIT and SWC_NAME_CODE are not defined in the .h file of your generated C code from the .slx (AUTOSAR model). This could be causing errors during the building phase.
One suggestion to resolve this issue is to configure Simulink to generate the necessary definitions for these variables. You can try the following steps:
  1. Open your Simulink model (.slx) in Simulink.
  2. Navigate to the Configuration Parameters by clicking on "Simulation" in the Simulink menu and selecting "Configuration Parameters."
  3. In the Configuration Parameters dialog box, go to the "Code Generation" section.
  4. Look for the option related to "Data and function memory sections" or similar.
  5. Enable the option to "Generate separate code and data sections" or a similar option that allows for separate code and data generation.
  6. Save the configuration settings and generate the code again.
By enabling the option to generate separate code and data sections, it is possible that Simulink will generate the necessary definitions for SWC_NAME_VAR_INIT and SWC_NAME_CODE in the relevant source files. These definitions will be separate from the header file and may help resolve the errors you are facing during the building phase.
  댓글 수: 1
oussama
oussama 2023년 7월 10일
Could you please be more specific for "Generate separate code and data sections" option ?
I'am using MATLAB R2020b and i can't find it .

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

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by