问题
My directory set up:
libone
one.c
one.h
Makefile.am
libtwo
two.c #includes one.h
two.h
Makefile.am
...
Makefile.am
configure.ac
...
Now when I do autoreconf -fvi and configure and make, I get the error from two.c: could not find one.h. How do I setup the include paths in Makefile.am's? Any help appreciated.
回答1:
Either do it the quick'n'dirty way
#include "../libone/one.h"
or (preferred, because then it doesn't matter whether one.h
is installed or in the source tree or split out into a different project)
#include <libone/one.h>
and in your Makefile.am
libtwo_a_SOURCES = two.c two.h
libtwo_a_CPPFLAGS = -I$(top_srcdir)
来源:https://stackoverflow.com/questions/13088365/automake-how-to-use-a-header-from-one-library-in-a-another-library-in-a-sister