Inclusion of custom ENUM file during code generation throwing error

1 回表示 (過去 30 日間)
Aditya
Aditya 2014 年 7 月 2 日
回答済み: Kaustubha Govind 2014 年 7 月 10 日
Hi,
I am trying to include following header file containing ENUM definition during my Auto-code generation
typedef enum { ENG_MOD_ENTRY_NON = 0 ,ENG_MOD_ENTRY_OFF ,ENG_MOD_ENTRY_SLOWON ,ENG_MOD_ENTRY_ON } ENG_MOD_ENTRY_ITMT;
But while code generation I am contineously getting the following error:
redeclaration of `ENG_MOD_ENTRY_NON ' previously declared at ..\l_TestIfDefine.h 21 redeclaration of `ENG_MOD_ENTRY_OFF' previously declared at ..\l_TestIfDefine.h 22 redeclaration of `ENG_MOD_ENTRY_SLOWON' previously declared at ..\l_TestIfDefine.h 23 redeclaration of `ENG_MOD_ENTRY_ON' previously declared at ..\l_TestIfDefine.h 24
How do I get rid of this error?

回答 (1 件)

Kaustubha Govind
Kaustubha Govind 2014 年 7 月 10 日
Is the header file getting included multiple times in the generated code? If so, you may want to try using include guards in the header.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by