2024-03-18 09:56 PM
I updated to the STM32CubeIDE 1.15 WIN, and since then my project has thrown up 100+ errors. It doesn't recognise "u_char" or "uint" or "caddr_t".
It throws up error "expected ')' before 'GPIO_TypeDef'" in the below statement :
void Write_MFRC522(u_char, u_char, GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
I have cleaned and built the project several times, how do I fix this?
2024-03-19 12:43 AM
Hello @Abhesheksh
First let me thank you for posting.
I would appreciate it if you could provide your project for further investigation.
I will be waiting for your feedback.
THX
Ghofrane
2024-03-19 03:11 AM
2024-03-19 03:23 AM - edited 2024-03-19 08:54 AM
@Abhesheksh wrote:my project has thrown up 100+ errors. It doesn't recognise "u_char" or "uint" or "caddr_t".
It throws up error "expected ')' before 'GPIO_TypeDef'"
That typically happens when there is one error early on in your code, and that one error is the cause of all the rest.
So the thing to do is to go to the very first reported error - most likely, a missing or not-found header.
"u_char" or "uint" or "caddr_t" are not standard types, so they must be defined somewhere in your code - presumably a header?
And, presumably, that header is not being found?
Clearly, that will cause every single use of any of these types anywhere in your code to fail - and you can see how that will quickly lead to loads of errors from just the one problem.
EDIT:
Here's an example of how just fixing the first-reported issue will actually solve multiple errors:
2024-03-19 03:53 AM - edited 2024-03-19 06:46 AM
go to the very first reported error
You need to look in the build console output - not in the 'Problems' list:
2024-03-19 06:00 AM
"u_char" is not a standard type. Find out where you're defining it, or use standard types like uint8_t or unsigned char instead.
2024-03-19 07:01 AM
> so they must be defined somewhere in your code - presumably a header?
The simplest way to fix this IMHO is to create a small .h file somewhere and "inject" it into compilation using GCC/G++ option -include "yourfile.h"
#pragma once
typedef unsigned char u_char;
typedef unsigned int uint;
typedef void *caddr_t;