-1

在制作过程中出现以下错误:

In file included from modGPRS.c:25:
../inc/intModGPRS.h:33:21: error: datapkt.h: No such file or directory

目录结构如下:datapkt.h 放在main_proj/libs/ipsec/itf.

libs文件夹有一个 Makefile,如下所示:

include $(BUILD_TOP)/build_control/stream/config.mk

SUBDIRS = tracing config stats srandom

SUBDIRS_$(B_HAS_EEPROM) += eeprom
SUBDIRS_$(B_LIBARCHIVE) += libarchive
ifeq ($(B_PLATFORM_openat),y)
    SUBDIRS += openat openssl asn1c mib zlib diff ipsec
else
    SUBDIRS += iniparser daemon ipsec
endif

stats_needs      = config

include $(BUILD_TOP)/build_control/stream/subdirs.mk

生成文件ipsec如下:

SDIRS += src itf
TOP?=..
RECURSIVE_MAKE= [ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
                    (cd $$i && echo "making $$target in $(DIR)/$$i..." && \
                    $(MAKE) -e TOP=$(TOP)/.. $$target INCLUDES='$(INCLUDES)') || exit 1; \
                done;

subdirs:
        @target=all; $(RECURSIVE_MAKE)

all: subdirs -I /itf

include $(BUILD_TOP)/build_control/stream/subdirs.mk

还有subdirs.mk如下:

#   This is a stand-alone file to distribute targets to
#   sub-directories. Include this file alone.  

#  Make bug: It loses track of if/endif over a $(eval) call.
ifndef __subdirs_include
__subdirs_include = yes

#   This only works for the standard targets defined in $(TARGETS)
#   in utils.mk. However this list can be extended with +=.

install:: install-hdrs

include $(BUILD_TOP)/build_control/stream/utils.mk
include $(BUILD_TOP)/build_control/stream/platform.mk

#  This creates a recursion rule for each pair of target and subdirectory.
#  The target for doing T in directory D is named T+D. 
#  If there is a "$(D_needs) = subdirs" then the subdirs become prerequisites
#  of D.
define __target_subdir
.PHONY:: $(1)+$(2)
$(1)+$(2) :: $(3); +$(MAKE) -C $(2) $(1)
endef

$(foreach t,$(TARGETS),\
    $(foreach d,$(strip $(SUBDIRS) $(SUBDIRS_y)),\
        $(eval $(call __target_subdir,$(t),$(d),$(patsubst %,$(t)+%,$($(d)_needs))))))

$(foreach t,$(TARGETS),\
    $(foreach d,$(strip $(SUBDIRS) $(SUBDIRS_y)),$(eval $(t)::$(t)+$(d))))


endif # __subdirs_include

有人可以帮我弄清楚,如何解决头文件的这个问题:datapkt.h?如果需要任何其他详细信息,请告诉我。

谢谢阳光

4

1 回答 1

-1

错误消息来自您的编译器。这是说该文件modGPRS.c(在它所在的任何目录中,称为A)已包含一个 file A/../inc/intModGPRS.h,该文件本身试图包含一个名为 的文件datapkt.h,但找不到该文件。这可能是因为您的 makefile 没有正确地告诉编译器文件在哪里datapkt.h,或者(更有可能)您没有安装必备库。

在尝试构建您正在尝试构建的任何内容之前,请确保您已经安装了需要安装的所有内容。至少没有告诉我您要安装的是什么,我无法进一步帮助您。

于 2013-06-21T21:00:20.660 回答