Including header file from static library
问题 I am making a test setup of a C static library and program. The library code, located in a subdirectory 'foo' 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 progam 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: build: #!/bin/bash gcc -c -Wall -Werror foo