1

For using some specific constants of MPTCP such as MPTCP_ENABLED, I include "<linux/tcp.h>"in iperf_tcp.c and modify the Makefile by inserting dirs ".../include/generated/uapi" ".../include/uapi" ".../include" to support. However, after I make the project, it still has problem with iperf_tcp.c:1319:39: error: ‘MPTCP_ENABLED’ undeclared (first use in this function)

The relative piece of Makefile is attached below. How to modify the Makefile to support it?

iperf3_profile-iperf_tcp.o: iperf_tcp.c
        $(AM_V_CC)$(CC) $(DEFS) -I /home/cx/mptcp/include/generated/uapi/ -I /home/cx/mptcp/include/uapi  -I /home/cx/mptcp/include/ $(AM_CPPFLAGS) $(CPPFLAGS) $(iperf3_profile_CFLAGS) $(CFLAGS) -MT iperf3_profile-iperf_tcp.o -MD -MP -MF $(DEPDIR)/iperf3_profile-iperf_tcp.Tpo -c -o iperf3_profile-iperf_tcp.o `test -f 'iperf_tcp.c' || echo '$(srcdir)/'`iperf_tcp.c
        $(AM_V_at)$(am__mv) $(DEPDIR)/iperf3_profile-iperf_tcp.Tpo $(DEPDIR)/iperf3_profile-iperf_tcp.Po
#       $(AM_V_CC)source='iperf_tcp.c' object='iperf3_profile-iperf_tcp.o' libtool=no \
#       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
#       $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iperf3_profile_CFLAGS) $(CFLAGS) -c -o iperf3_profile-iperf_tcp.o `test -f 'iperf_tcp.c' || echo '$(srcdir)/'`iperf_tcp.c

iperf3_profile-iperf_tcp.obj: iperf_tcp.c
        $(AM_V_CC)$(CC) $(DEFS)   -I /home/cx/mptcp/include/generated/uapi/ -I /home/cx/mptcp/include/uapi  -I /home/cx/mptcp/include/ $(AM_CPPFLAGS) $(CPPFLAGS) $(iperf3_profile_CFLAGS) $(CFLAGS) -MT iperf3_profile-iperf_tcp.obj -MD -MP -MF $(DEPDIR)/iperf3_profile-iperf_tcp.Tpo -c -o iperf3_profile-iperf_tcp.obj `if test -f 'iperf_tcp.c'; then $(CYGPATH_W) 'iperf_tcp.c'; else $(CYGPATH_W) '$(srcdir)/iperf_tcp.c'; fi`
        $(AM_V_at)$(am__mv) $(DEPDIR)/iperf3_profile-iperf_tcp.Tpo $(DEPDIR)/iperf3_profile-iperf_tcp.Po
#       $(AM_V_CC)source='iperf_tcp.c' object='iperf3_profile-iperf_tcp.obj' libtool=no \
#       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
#       $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iperf3_profile_CFLAGS) $(CFLAGS) -c -o iperf3_profile-iperf_tcp.obj `if test -f 'iperf_tcp.c'; then $(CYGPATH_W) 'iperf_tcp.c'; else $(CYGPATH_W) '$(srcdir)/iperf_tcp.c'; fi`
Trista
  • 11
  • 2
  • Welcome to Stack Overflow. Please look at our [intro section](https://stackoverflow.com/help), with special attention to the page on [minimal complete examples](https://stackoverflow.com/help/minimal-reproducible-example). When you reduce your makefile and code to the simplest example that reproduces the error, you will probably discover the bug yourself. And if not, you can then post an example which others on this site can use to explore the problem. – Beta Mar 19 '21 at 02:19
  • Were there warnings or errors about not finding the include file? Are you sure that `MPTCP_ENABLED` would be defined if you simply include the file, or does it require something else to be defined first? – jwdonahue Mar 19 '21 at 03:09
  • Did you try [searching for related issues](https://www.google.com/search?q=MPTCP_ENABLED)? – jwdonahue Mar 19 '21 at 03:11
  • I deleted my non-answer and gave the question a bump, so maybe someone with more recent *nix make experience will wander in here and help you. Check all those relative include paths, are where you think they are, relative to your make file. – jwdonahue Mar 19 '21 at 23:26
  • [Edit] your post to include a code block showing how you include everything in your source file. You might also want to try changing `#include ` to just `#include `. – jwdonahue Mar 19 '21 at 23:31

0 Answers0