Consider the following code:
header.h
typedef struct foo_tag__ foo;
int do_something(foo data);
private.h
struct foo_tag__
{
/* Some fields go here. */
int foo1;
int foo2;
double some_value;
};
program.c
#include "header.h"
#include "private.h"
int main()
{
/* Do something */
return(0);
}
Now when I do this, I get errors all over the place. So is it possible to define opaque types using two different header files? One is public and the other is private which is not placed in the include directory.
EDIT: Based on additional research, I've opted to use void * pointers instead to provide an opaque interface to the library. This question is ok to close. Additionally, the linked question, although similar, is not the same as I was trying to define an opaque type in one header file, and then fill out the definition in a different header file because it is used in more than one file. Furthermore, the linked question does not have an answer marked.