0

I'm trying to build a project, which depends on Apache httpd. Unfortunately, I have and need the httpd sources to be in /usr/includes, while the project provides its own headers for httpd (of a different version!) in $(project)/common/includes. I want the gcc to pick up the headers from the project's directory instead of the /usr/includes, but I'm afraid that even if I'm successful with it, I will probably miss other important headers from /usr/includes.

Any ideas on how to do this?

EDIT: the relevant part of the Make file looks something like this:

CFLAGS = -Wall -O3 -fPIC -fomit-frame-pointer -I vm -D_GNU_SOURCE -I libs/common -D_64BITS
EXTFLAGS = -pthread
MAKESO = $(CC) -shared #-WBsymbolic

# later ...

all: createbin libneko neko std compiler libs

neko: bin/neko

# later ...

bin/neko: $(VM_OBJECTS)
    ${CC} ${CFLAGS} ${EXTFLAGS} -o $@ ${VM_OBJECTS} ${NEKOVM_FLAGS}
    strip bin/neko

Somewhere while executing this "recipe" I'm getting:

In file included from /usr/include/httpd/httpd.h:43:0,
                 from mod_neko.h:20,
                 from mod_neko.c:17:
/usr/include/httpd/ap_config.h:25:17: fatal error: apr.h: No such file or directory

But it shouldn't have used /usr/include/httpd/httpd.h because there's <project> /libs/include/apache2/httpd.h

4

1 に答える 1

0

ここでは、 gccに関する情報に検索パスが含まれています

GCC は、いくつかの異なる場所でヘッダーを探します。通常の Unix システムでは、特に指示がない場合、#include で要求されたヘッダーを次の場所で探します。

 /usr/local/include
 libdir/gcc/target/version/include
 /usr/target/include
 /usr/include

-Idir コマンド ライン オプションを使用して、このリストに追加できます。-I で指定されたすべてのディレクトリが、デフォルトのディレクトリの前に左から右の順序で検索されます

于 2012-10-03T12:24:24.843 に答える