所以我在我的头path.h
定义的结构如下:“提领指向不完全类型”
typedef struct path Path;
struct Path {
Path* branching_paths;
uint32_t nb_paths;
};
,并在相同的标题我已经声明和定义下列内联函数:
inline void init_path(Path* path);
inline void init_path(Path* path){
path->branching_paths = NULL;
path->nb_paths = 0;
}
而且我不知道是什么原因,我得到这个错误。我已经在网上搜索,但据我看,我已经在头正确定义的结构,还是我失去了一些东西?
./../Path.h:54:9: error: dereferencing pointer to incomplete type 'Path {aka struct path}'
path->branching_paths = NULL;
这是因为结构的路径是不一样的结构路径。 – 2501
但如果我键入typedef结构路径路径,我没有叫它然后路径? – malajedala
什么是'struct path'? – yano