Build issue - error directive usage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-26 12:28 PM
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,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-26 12:51 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-26 1:04 PM - edited ‎2024-01-26 1:06 PM
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.
