I cannot compile a C file that contain a function-call of a function, which is in another file. The compilation gives an error which says that there is an undefined reference even if I included the relative path to the Header file in the compilated file.
#include <stdio.h>
#include "../libft.h"
void *ft_memmove(void *dest, const void *src, size_t n)
{
unsigned char *d;
unsigned char *s;
size_t i;
d = (unsigned char *)dest;
s = (unsigned char *)src;
i = 0;
if (s < d)
{
while (n--)
d[n] = s[n];
}
else
ft_memcpy(d, s, n);
return (d);
}
int main()
{
char str[] = "memmove can be very useful.....";
ft_memmove (str+20, str+15, 11);
puts (str);
return (0);
}
The error that I get : gcc complier error
The header file : the header file
Can you help me please to resolve this problem ?