0

I have a function myfunc defined in a source file myfunc.c and declared in a header file myfunc.h. Both these files are part of a library.

In another project's (projA) source file, I am including the header file as:

#include "myfunc.h"

and using the function correctly (number of parameters, order, etc).

I've edited the Makefile so it has the path to myfunc.h in it's list of includes (-I).

However, I am still getting a warning about implicit declaration. Since projA has warning = error set, it fails on compilation.

Note: this is not an eclipse issue as here, or a missing header as here, or an undeclared function.

Addendum

int myfunc(char * source, size_t source_len, char * dest, size_t dest_len)
{
    // manipulation
    strncpy(dest, source, dest_len);
    // other stuff
}
Community
  • 1
  • 1
Sagar
  • 9,456
  • 6
  • 54
  • 96

1 Answers1

1

Take a look at this https://gcc.gnu.org/onlinedocs/cpp/Ifdef.html
You may need to add this in to your Header files to avoid duplicate inclusion

oliverpool
  • 1,624
  • 13
  • 30
EyeOfTheHawks
  • 576
  • 1
  • 5
  • 16