1

我正在尝试在现有应用程序上运行一个名为crest的工具。我的第一个目标应用程序是 Apache。输出(如下图)表明没有找到一些头文件。它们位于源文件夹中的其他目录中。其中之一是 \httpd-2.2.14\srclib\apr\include。我宁愿不更改 apache 的源代码,因为我希望对 Apache 中的大量文件运行此命令,然后将相同的技术应用于其他几个应用程序。

我的问题是:

1)我怎样才能做到这一点,以便在查找这些引用的包含文件时,它会找到它们所在的正确目录并将使用该目录。我可以定义目录。有朋友提到改变命令行输入,或者构建环境变量?

其他想法/建议将不胜感激。

谢谢大家。

运行 crest 的命令是: ../bin/ crestc ../../httpd-2.2.14/server/request.c -dfs

我得到以下输出:

[root@localhost src]# ../bin/crestc ../../httpd-2.2.14/server/request.c -dfs
cp libcrest/libcrest.a ../lib
cp run_crest/run_crest ../bin
cp process_cfg/process_cfg ../bin
cp tools/print_execution ../bin
cp libcrest/crest.h ../include
cp libcrest/libcrest.a ../lib
cp run_crest/run_crest ../bin
cp process_cfg/process_cfg ../bin
cp tools/print_execution ../bin
cp libcrest/crest.h ../include
gcc -D_GNUCC -E -I../bin/../include -DCIL=1 ../../httpd-2.2.14/server/request.c -o ./request.i
../../httpd-2.2.14/server/request.c:28:25: error: apr_strings.h: No such file or directory
../../httpd-2.2.14/server/request.c:29:25: error: apr_file_io.h: No such file or directory
../../httpd-2.2.14/server/request.c:30:25: error: apr_fnmatch.h: No such file or directory
../../httpd-2.2.14/server/request.c:33:22: error: apr_want.h: No such file or directory
../../httpd-2.2.14/server/request.c:36:23: error: ap_config.h: No such file or directory
../../httpd-2.2.14/server/request.c:37:19: error: httpd.h: No such file or directory
../../httpd-2.2.14/server/request.c:38:25: error: http_config.h: No such file or directory
../../httpd-2.2.14/server/request.c:39:26: error: http_request.h: No such file or directory
../../httpd-2.2.14/server/request.c:40:23: error: http_core.h: No such file or directory
../../httpd-2.2.14/server/request.c:41:27: error: http_protocol.h: No such file or directory
../../httpd-2.2.14/server/request.c:42:22: error: http_log.h: No such file or directory
../../httpd-2.2.14/server/request.c:43:23: error: http_main.h: No such file or directory
../../httpd-2.2.14/server/request.c:44:25: error: util_filter.h: No such file or directory
../../httpd-2.2.14/server/request.c:45:26: error: util_charset.h: No such file or directory
../../httpd-2.2.14/server/request.c:46:25: error: util_script.h: No such file or directory
../../httpd-2.2.14/server/request.c:48:22: error: mod_core.h: No such file or directory
BRead 0 branches.
Read 0 nodes.
Wrote 0 branch edges.
[root@localhost src]#
4

1 回答 1

2

您可以设置C_INCLUDE_PATH环境变量(使用 a:分隔多个路径):

 export C_INCLUDE_PATH=/path/to/include/files:/path/to/more/include/files
于 2013-01-17T15:16:18.937 回答