How do I avoid a multi-declaration issue with code generation for autosar.tlc?

1 view (last 30 days)
I am generating code with an autosar.tlc target. I have multiple models that each use a "2D Lookup Table" block, and for each model I generate code and compile it into an object file. When linking the object files together, there is a multiple definition issue because each source code uses the same name for the "2D Lookup Table" Block. Is there a way to change the name generated in the code or otherwise get around this for an autosar.tlc target?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 24 Nov 2020
In the Code Placement settings, set the file packaging format to 'Compact' or 'Compact (with separate data file)', and then check the option in Code Style settings to 'preserve static keyword in function declarations'.
This is a setting that is available for AUTOSAR code generation targets which will allow you to link different executables that use the same function name. You may refer to the documentation below to understand these settings better:

More Answers (0)

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!