My static library was compiled with all functions I have but when I'm using it, i'm getting an error:
warning: implicit declaration of function 'ft_putnbr' is invalid in C99 [-Wimplicit-function-declaration]
My source code:
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(void)
{
int fd;
fd = open("42", O_CREAT | O_WRONLY, S_IRUSR, S_IWUSR);
ft_putnbr(fd);
return (0);
}
I'm compiling with this option:
gcc main.c -L. -lft
My static library is named and contain ft_putnbr function: libft.a
But when I wrote: include "libft.h" it's working
Why it's not working without include "libft.h" ?