-1

I am getting the following error during make:

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

The directory structure is as follows: datapkt.h is placed at main_proj/libs/ipsec/itf.

libs folder has a Makefile which is as follows:

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

Makefile for ipsec is as follows:

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

Also subdirs.mk is as follows:

#   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

could someone please help me figure out, how to solve this issue of the header file: datapkt.h? Please let me know if any other details are required.

Thanks Sunny

Sunny
  • 7,444
  • 22
  • 63
  • 104

1 Answers1

-1

The error message is from your compiler. It is saying that the file modGPRS.c (in whatever directory it is in, call it A) has included a file A/../inc/intModGPRS.h, which is itself trying to include a file called datapkt.h, which cannot be found. This is either because your makefiles are not properly telling the compiler where the file datapkt.h is, or (more likely) you have not installed a prerequisite library.

Make sure you have installed everything that needs to be installed before trying to build whatever it is that you're trying to build. Without at least telling me what it is you're trying to install I can't help you further.

Zorawar
  • 6,505
  • 2
  • 23
  • 41
  • -1 for not explaining how to tell the compiler where to find the file (using the `CFLAGS` variable) in the Makefile. See http://stackoverflow.com/a/22545645/1881810 for more information. – 7heo.tk Mar 22 '17 at 15:50
  • @7heo.tk: unless they have defined their own target and maybe are using a different variable name, which is why I asked for more information. The point is that it looks like they have been given something to install and the problem is more likely to be an incorrect setup rather than being expected to edit makefiles. – Zorawar Mar 22 '17 at 16:40
  • people will find this question via a search engine, searching for "makefile headers variable" or something similar, and will not find it. I agree that the question is too vague, but unfortunately it doesn't mean that the answer can be left vague. – 7heo.tk Mar 22 '17 at 20:10
  • There are plenty of other questions on this site they could turn to. Thus, that was not a consideration for me since the question didn't ask how to do it in general, they wanted help with their problem and I gave an answer that I thought would be more useful to them. I could have mentioned `CFLAGS` it's true, but a comment above already mentioned that, so I didn't see the point in repeating the point. I don't think my answer merited a downvote but so be it. – Zorawar Mar 23 '17 at 00:21
  • "There are plenty of other questions on this site they could turn to.". My search engine led me to that particular one. I expect this to reproduce in the future, hence my comment. Also, the question is extremely vague, they just asked for "help". So a general answer would fit very well here IMHO. TL;DR: I still think this isn't a type of question or answer I wish to see on SO (and I downvoted the question too for that reason). I also don't think it's a good idea to discuss this here. – 7heo.tk Mar 23 '17 at 14:01