Why do I get too many compilation errors like <identifier "XXX" is undefined> though I added the related header files in Polyspace?
6 views (last 30 days)
Show older comments
MathWorks Support Team
on 26 Jun 2023
Edited: MathWorks Support Team
on 26 Jun 2023
I included all used header files' folders for compilation but I see too many errors like <identifier "XXX" is undefined>.
Here are the error formats.
1. identifier "XXX" is undefined
Detail:
File C:\aaa\...\bbb.h line xx
Error: identifier "XXX" is undefined
XXX __YY;
^
2. #error directive: Endianess not declared!!
Detail:
File C:\aaa\...\ccc.h line xx
Error: #error directive: Endianess not declared!!
#error directive: Endianess not declared!!
^
3. expected an expression // Failed compilation
Detail:
File C:\aaa\...\ddd.h line xx
Error: expected an expression
# if __BYTE_ORDER == __BIG_ENDIAN
^
Accepted Answer
MathWorks Support Team
on 26 Jun 2023
Edited: MathWorks Support Team
on 26 Jun 2023
The most frequent compilation issue is caused with undefined identifiers. Here is a troubleshooting section in the documentation:
The common root cause is that there would be a macro setting for "XXX", __BYTE_ORDER, __BIG_ENDIAN etc. in the related header files, and this information is defined in your compiler. Therefore, Polyspace does not recognize it. You can replace or remove the compiler-specific the analysis option, see Preprocessor definitions (-D). Usually, there are few cases where these tasks are done manually, and it is recommended to create the project with polyspace-configure by recognizing the compiler automatically.
Note: If you can speak Korean, here is the webinar video below for using polyspace-configure to generate project automatically.
0 Comments
More Answers (0)
See Also
Categories
Find more on Command-Line Only Options in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!