I am doing a test setup of the static library and program C. The library code located in the "foo" subdirectory of my project contains the following files:
Foo / foo.c:
#include <stdio.h> void foo(void) { printf("something"); }
Foo / foo.h:
#ifndef foo_h__ #define foo_h__ extern void foo(void); #endif
My program code is as follows:
test.c:
#include "foo.h" int main() { foo(); return 0; }
I have a build script called 'build' which contains the following:
assembly:
But when I run the assembly, it causes the following error:
test.c:1:17: fatal error: foo.h: No such file or directory #include "foo.h" ^ Compilation terminated
However, it works when I omit the #include line, but I would prefer to use the header files in my static libraries. What am I doing wrong, and how can I fix it?
source share