0

I am working on lwip TCP/IP stack on a TI microcontroller board. To simply explain, I have two source folders "ipv4" and "ipv6". Both have their corresponding folders for header files in the "include" folder.

Both have some functions and structs with the same name. I have included the paths for both. However, it is giving me errors in almost all of functions in the files in "ipv6" folder as if it cannot find the folder for header files and instead goes to the "ipv4" folder for header files as it also has the same functions but with different number of arguments.

What am I doing wrong?

  • 2
    You cannot have 2 functions with different arguments that have the same name. – Jabberwocky Jan 07 '16 at 16:20
  • Many of the details of header file lookup are specific to your compiler. For typical compilers, they are furthermore influenced by the compilation options you specify. If what you are doing should even be expected to work (see BrianMcFarland's answer) then whatever is going wrong is related to compilation details that you did not present. – John Bollinger Jan 07 '16 at 17:06
  • @MichaelWalz, not exactly. You cannot have two different functions with same name and the same linkage visible in the same scope, regardless of the arguments. You *can* have different functions with the same name -- and different arguments, if desired -- if they have different linkage (i.e. one is `static`, and the is other `extern` and not declared nor used in the scope of the the first), or if they are not both visible in the same scope (i.e. both are `static` and they are defined in different translation units). – John Bollinger Jan 07 '16 at 17:15

1 Answers1

1

Straight from LwIP wiki:

Support for IPv6 is currently being added to LwIP. Up to version 1.4.x LwIP can use either IPv4 or IPv6, but not both. Code for dual Stack operation is in the current development version (which can be downloaded from git). It will probably be released as version 1.5.0. Some consider LwIP IPv6 quite stable.

So unless you're using the unstable / dev version, you can't use both. Sounds like attempting to is what's causing your problems.

Brian McFarland
  • 9,052
  • 6
  • 38
  • 56