I have two units of code (featureA.c, featureA.h) (featureB.c, featureB.h). featureB
has an include to featureA.h
because it uses a function there, when i do this, everything works out.
gcc -Wall -O0 -std=c11 -g -o test.exe test.o featureA.o featureB.o -lpthread
However, now I want to distribute my libraries. When I attempt to make an example project with.
gcc -Wall -O0 -std=c11 -g -o target/example.exe example/main.c lib/libfeatureA.a lib/libfeatureB.a -lpthread
It says that there is an undefined reference to the function i need in featureA
from featureB.
Why does the linking not resolve this? Does this mean I should just deliver one giant library?
And follow up. What is the standard way to distribute .h files and libraries?