I have a header file which has an include guard setup. I have multiple C files in my project that require this header file for compilation. When I go to compile however I get an error saying that the function has already been included from another file. Shouldn't the include guard prevent this from happening? In theory I believe I should be able to import this file a bunch of times and not have this issue.
#ifndef __BST_INCLUDED
#define __BST_INCLUDED__
//bunch of code here
#endif
Error:
bst.h:22:13: error: conflicting types for ‘pruneBSTNode’
extern void pruneBSTNode(bst *tree,bstNode *node);
^
In file included from vbst.h:5:0,
from bstrees.c:7: