unknown type name 'uint8_t'

Share code examples or discuss embedded software, including device drivers, interrupt handlers, middleware and application code.

Moderators: Markus Girdland, Mattias Norlander

gregL1978
Posts: 2
Joined: Tue Oct 23, 2018 4:16 pm

unknown type name 'uint8_t'

Postby gregL1978 » Tue Oct 23, 2018 4:32 pm

I am new to Atollic TrueSTUDIO. I used CooCox before I switch to TrueSTUDIO.

I started a project using STM32CubeMX. I specified my toolchain/IDE as TrueSTUDIO. Everything is fine. I can compile and run my project. Then I created a new c source file in Src folder. I declared a variable in the new c file

uint8_t SchCnt;

I got the error when I compile my project error: unknown type name 'uint8_t'

Then I checked the main.c file. It is ok to use uint8_t in main.c. So I copied the includes in main.c to my new c file

/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f3xx_hal.h"

I still got the same error message.

Anyone knows why?

Greg

Thanks!

paulvdh
Posts: 2
Joined: Tue Oct 23, 2018 5:42 pm

Re: unknown type name 'uint8_t'

Postby paulvdh » Tue Oct 23, 2018 5:44 pm

#include <stdint.h>

gregL1978
Posts: 2
Joined: Tue Oct 23, 2018 4:16 pm

Re: unknown type name 'uint8_t'

Postby gregL1978 » Tue Oct 23, 2018 9:58 pm

Thank you, paulvdh! it works.

Then why I CAN use uint8_t to declare variables in main.c? there is no #include <stdint.h> in main.c file.

I thought that one of the 2 .h files included in main.c have unit8_t defined. So I coped from main.c the following lines

/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f3xx_hal.h"

to my c file and I still got error message.

I used Keil, IAR and CooCox and never had issue

andrew007
Posts: 1
Joined: Mon Nov 19, 2018 9:25 pm

Re: unknown type name 'uint8_t'

Postby andrew007 » Mon Nov 19, 2018 9:47 pm

I have recently encountered with the type name unit8_t error which is a very problematic thing. I was looking many days for the fix but could not remove the error on my own for that I have to take part in that thing. Visit error code 43 mac to know about the fixes.


Return to “Embedded target code development discussions”

Who is online

Users browsing this forum: No registered users and 1 guest