1

1つのファイルに構造体abcがあります

struct abc {
    some variaables
    and functions
}

次のように、この構造体を他のファイルで使用しています: struct abc *t = kmalloc(sizeof(struct abc)); kmalloc は malloc と同等です

次に、次のエラーが発生します。

expected '=', ',', ';', 'asm' or '__attribute__' before 'struct'
error: variable 't' has initializer but incomplete type
warning: implicit declaration of function 'kmalloc'
invalid application of 'sizeof' to incomplete type 'struct trapframe'
storage size of 't' isn't known

どこが間違っているのですか?

4

2 に答える 2