0

I have my own library with some basic functions inside which I compile using ar rcs *a few .o files*

Now I'm in a project where I have to use this library the code is basic :

#include "libft.h"

int main()
{
    ft_putstr_fd("test", 1);
    return (0);
}

I create the binary file using this command clang -fsanitize=address -ILIBFT/includes/ -c test.c -o test.o
And when trying to make the final executable file I get this and I don't understand why... Does it have something to do with the fact that I'm using Ubuntu 20.04 ?

Here's the command when I create the executable file clang -fsanitize=address -ILIBFT/includes/ -L LIBFT -lft -o test test.o And here's the output :

/usr/bin/ld: test.o: in function `main':
test.c:(.text+0x1f): undefined reference to `ft_putstr_fd'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The function does is defined in libft.h as it works on my school's iMac.

Thanks for your help.

Jules
  • 346
  • 1
  • 3
  • 15

0 Answers0