error: unknown type name uint8_t Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
dotaviper
Posts: 10
Joined: Mon Sep 28, 2015 4:44 am
Has thanked: 3 times

error: unknown type name uint8_t

Post by dotaviper »

Create two new files key.c and key.h and add them to my project.
step1: defined a global variable in key.c: uint8_t PHOTO_COUNT = 0;
step2: extern it in key.h:extern uint8_t PHOTO_COUNT;
step3:add #include "key.h" in key.c and main.c
step4: add key.c in makefile.

Code: Select all

# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(STARTUPSRC) \
       $(KERNSRC) \
       $(PORTSRC) \
       $(OSALSRC) \
       $(HALSRC) \
       $(PLATFORMSRC) \
       $(BOARDSRC) \
       $(TESTSRC) \
       main.c  \
       key.c  \
 

step5: use the variable in main.c: PHOTO_COUNT=1;
after building,there are 2 eerors:
key.h:19:1: error: unknown type name 'uint8_t'
key.c:31:9: error: conflicting types for 'PHOTO_COUNT'
expected your answers,thank you .
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: error: unknown type name uint8_t

Post by Giovanni »

You need to include stdint.h.

Giovanni
Post Reply