描述:
RT-Thread添加软件包会出现uint8_t uint16_t uint32_t size_t未定义
大致出错内容,如下:
riscv64-unknown-elf-gcc "../applications/blehr_app.c"
../applications/blehr_app.c:25:40: error: unknown type name 'uint16_t'; did you mean 'rt_uint16_t'?
25 | void bthw_get_heap_info(void **p_heap, uint16_t **p_heap_size, uint32_t *p_block_size);
| ^~~~~~~~
| rt_uint16_t
../applications/blehr_app.c:25:64: error: unknown type name 'uint32_t'; did you mean 'rt_uint32_t'?
25 | void bthw_get_heap_info(void **p_heap, uint16_t **p_heap_size, uint32_t *p_block_size);
| ^~~~~~~~
| rt_uint32_t
../applications/blehr_app.c:26:73: error: unknown type name 'uint32_t'; did you mean 'rt_uint32_t'?
26 | typedef void (*nsmem_cb_init_func)(void *heap_buf, void *heap_size_buf, uint32_t mem_block_max);
| ^~~~~~~~
| rt_uint32_t
../applications/blehr_app.c: In function 'btctrl_mem_init':
../applications/blehr_app.c:32:5: error: unknown type name 'uint16_t'; did you mean 'rt_uint16_t'?
32 | uint16_t *heap_size_buf;
| ^~~~~~~~
| rt_uint16_t
../applications/blehr_app.c:33:5: error: unknown type name 'uint32_t'; did you mean 'rt_uint32_t'?
33 | uint32_t block_size;
| ^~~~~~~~
| rt_uint32_t
../applications/blehr_app.c:35:5: warning: implicit declaration of function 'bthw_get_heap_info' [-Wimplicit-function-declaration]
35 | bthw_get_heap_info(&heap_buf, &heap_size_buf, &block_size);
| ^~~~~~~~~~~~~~~~~~
../applications/blehr_app.c:27:27: error: 'nsmem_cb_init_func' undeclared (first use in this function); did you mean 'nsmem_cb_init'?
27 | #define nsmem_cb_init ((nsmem_cb_init_func)0x84140)
| ^~~~~~~~~~~~~~~~~~
../applications/blehr_app.c:36:5: note: in expansion of macro 'nsmem_cb_init'
36 | nsmem_cb_init(heap_buf, heap_size_buf, block_size);
| ^~~~~~~~~~~~~
../applications/blehr_app.c:27:27: note: each undeclared identifier is reported only once for each function it appears in
27 | #define nsmem_cb_init ((nsmem_cb_init_func)0x84140)
| ^~~~~~~~~~~~~~~~~~
../applications/blehr_app.c:36:5: note: in expansion of macro 'nsmem_cb_init'
36 | nsmem_cb_init(heap_buf, heap_size_buf, block_size);
| ^~~~~~~~~~~~~
../applications/blehr_app.c:27:46: error: expected ')' before numeric constant
27 | #define nsmem_cb_init ((nsmem_cb_init_func)0x84140)
| ~ ^~~~~~~
../applications/blehr_app.c:36:5: note: in expansion of macro 'nsmem_cb_init'
36 | nsmem_cb_init(heap_buf, heap_size_buf, block_size);
| ^~~~~~~~~~~~~
make: *** [applications/subdir.mk:24: applications/blehr_app.o] Error 1
"make -j4 all2" terminated with exit code 2. Build might be incomplete.