0

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.

4

1 回答 1

0

要么做它快速'n'dirty的方式

#include "../libone/one.h"

或(首选,因为无论one.h是安装还是在源代码树中还是拆分到不同的项目中都没有关系)

#include <libone/one.h>

在你的Makefile.am

libtwo_a_SOURCES = two.c two.h
libtwo_a_CPPFLAGS = -I$(top_srcdir)
于 2012-10-26T19:43:38.267 回答