I can't use my own type in the function prototype
Posted: Mon May 04, 2020 5:56 pm
Hi.
I try to use the structure in my project, but I run into problems.
I have 2 files, lfbmemory.h(also have lfbmemory.c) and more.h (also have more.c).
In lfbmemory.c this structure was created.
In the file more.h I declare a function prototype that works with this structure.
But I get the following error when compiling lfbmemory.c
Here(see lfbmemory and more folders) you can find the full versions of these files, which may help.
Thanks.
I try to use the structure in my project, but I run into problems.
I have 2 files, lfbmemory.h(also have lfbmemory.c) and more.h (also have more.c).
In lfbmemory.c this structure was created.
Code: Select all
typedef struct ssfn_text_cursor {
uint32_t x;
uint32_t y;
uint32_t context_index;
} __attribute__((packed)) ssfn_text_cursor_t;
Code: Select all
extern void show_base_info(ssfn_text_cursor_t* text_cursor);
Code: Select all
Build ./source/lfbmemory/lfbmemory.c
In file included from ./source/lfbmemory/../memory/memmmu/../memdetect/memdetect.h:9:0,
from ./source/lfbmemory/../memory/memmmu/memmmu.h:9,
from ./source/lfbmemory/lfbmemory.h:9,
from ./source/lfbmemory/lfbmemory.c:1:
./source/lfbmemory/../memory/memmmu/../memdetect/../../more/more.h:13:28: error: unknown type name ‘ssfn_text_cursor_t’
extern void show_base_info(ssfn_text_cursor_t* text_cursor);
Thanks.