This is probably a linking error. When you compile the client program, you need to tell the linker where to find the library. For linux that would be
gcc client.c -L<path/to/lib> -llib -o client
. You can find instructions for doing that for a VisualStudio project
Here[
^]
Your question asks "Can referencing the library with TWO includes cause problem?". The answer is "Maybe". If the include file has
#include guards
, then no, but otherwise, "Probably".
example #include file with guards
#ifndef MY_LIB_H
#define MY_LIB_H
struct s {
int i;
double d;
};
int foo(struct s *my_struct);
#endif
Without the include guards, the compiler should complain about multiple definitions of
struct s
, if the header file is included more than once.