gcc -Wall -Werror -Wextra -Llibft -lft -Ilibft/include main.c
When I use the command above, the linker throws the following error message:
/tmp/ccwCUgov.o: In function `main':
main.c:(.text+0xc): undefined reference to `ft_putendl'
collect2: error: ld returned 1 exit status
I have to mention that the library libft.a
in use does exist in the libft/
directory.
I'm coding on Ubuntu 18.04LTS right now(2019), but I have never encountered such problem on macOS.
The code in main.c
:
#include "libft.h"
int main()
{
ft_putendl("Hello world!");
return (0);
}