关于GCC编译C语言多文件出现相似dereferencing pointer to incomplete type ‘struct TreeNode’的问题

    系统Ubuntu 16.04    编译器Gcc   语言Cnode

    

工程里面有tree.c, tree.h, fatal.h, main.c,本错误的意思大概是重定向treenode结构体的不兼容的指针。经查资料可知,错误缘由是spa

Because in compiling main.c, only the typdef is visible, not the definition of struct Treenode (which is in A.c). 指针

汉语意思是在编译main.c文件的过程当中,只有typedef类型是可视化的,而不是结构体的定义。ci

因此若是想要在main.c中识别到结构体,须要把结构体的相关实现添加在头文件中。get

来源:http://stackoverflow.com/questions/4518018/compiler-error-dereferencing-pointer-to-incomplete-type-in-c-programming编译器

相关文章
相关标签/搜索