gpt4 book ai didi

linux - 使用 make 编译期间未找到头文件 (Linux)

转载 作者:太空宇宙 更新时间:2023-11-04 05:36:11 25 4
gpt4 key购买 nike

我在 make 过程中遇到以下错误:

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 的 Makefile 如下:

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

另外ubdirs.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 的这个问题吗?如果需要任何其他详细信息,请告诉我。

谢谢阳光明媚

最佳答案

错误消息来自您的编译器。据说文件modGPRS.c(无论它在哪个目录中,都将其称为A)包含了一个文件A/../inc/intModGPRS.h,该文件本身试图包含一个名为datapkt.h的文件,但无法找到该文件。这可能是因为您的 makefile 没有正确告诉编译器文件 datapkt.h 的位置,或者(更有可能)您还没有安装必备库。

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

关于linux - 使用 make 编译期间未找到头文件 (Linux),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17206282/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com