Replicated Functions in Simulink Coder

3 ビュー (過去 30 日間)
Timothy Koehler
Timothy Koehler 2016 年 4 月 20 日
コメント済み: Karel Viaene 2022 年 3 月 3 日
What is the proper way to generate multiple C-models from Simulink and be able to use them in a common application?
The crux of my problem is when Simulink automatically creates a function, such as " rt_hypotd()" (which is just implementing an abs() function that also does complex abs()). This function would be embedded in " modelA.c", if I create code from model A. If I also have model B, that has similar functions, it will generate " modelB.c", which also contains rt_hypotd().
When trying to compile both models for usage interactively (there is some existing code in between them, which is the desire to have modular pieces of C code that I can use), I will get an error that rt_hypotd() is already defined.
Playing with all sorts of options has not allowed me to be able to appropriately set up something like a namespace such that I can use multiple C models without getting name collisions.

回答 (2 件)

Benjamin Couillard
Benjamin Couillard 2017 年 1 月 20 日
Hi,
I have the same problem as you do. Have you found a suitable solution or workaround?
Regards

Karel Viaene
Karel Viaene 2022 年 3 月 1 日
I have the same problem still, is there already a workaround?
  2 件のコメント
Timothy Koehler
Timothy Koehler 2022 年 3 月 2 日
To date, I think my team still has to manually remove one of the duplicate definitions in one of the .c files.
Karel Viaene
Karel Viaene 2022 年 3 月 3 日
Thank you Timothy for your reply.
It is unbelievable that this is still an issue 6 years later. Adding the option to generate namespaces per model or unique names per model would resolve this.
Unfortunatly I will also resort to manual adaptations.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEmbedded Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by