Skip to main content
Senior
January 26, 2024
Question

Build issue - error directive usage

  • January 26, 2024
  • 2 replies
  • 1603 views

Hi All,

 

I am having a strange error. When I compile my code, the error directive causes the ERROR. I can not pinpoint the issue. Could you please hint me in the right direction?

Thanks and Regards,

 

demir_0-1706300477525.png

 

    This topic has been closed for replies.

    2 replies

    TDK
    January 26, 2024

    Well, the error message says the cc950.c file is not needed in the current configuration and to remove it from the project.

    I would guess that this means the file is not needed in the project and that you should delete it or otherwise exclude it from the build.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    Associate II
    January 26, 2024

    Hello @demir 

    this one is easy: your project links too many .c files for code pages. This is detected by checking the value of _CODE_PAGE in each of them. As this define has a specific value, probably set by a FatFS configuration header file, the only .c file which is not generating this error should be kept from link and the others have to be removed, just as the error message says it clearly.

    The reasons for this are:

    • only one code page is active at a time
    • it saves space from useless data in object files
    • it avoids linker issues like duplicate symbols (uni2oem would be declared many times...)

    By the way, the #error directive is very useful and is generally used to detect an issue imagined by the developer before the preprocessor/compiler/linker falls into it. Therefore it has to display a more explicit message for a human to understand.