Building using MinGW

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Building using MinGW

Gisle Vanem-3
Trying to build lwIP using TDM-gcc 5.1.0 (MinGW), now produces
this error:
   In file included from f:/MingW32/src/inet/libpcap/pcap/pcap.h:74:0,
                    from f:/MingW32/src/inet/libpcap/pcap.h:43,
                    from contrib/ports/win32/pcapif.c:50:
   f:/MingW32/src/inet/libpcap/pcap/pcap-inttypes.h:48:6: error: #error "Building libpcap
requires VS 2015 or   later"
        #error "Building libpcap requires VS 2015 or later"
         ^


The cause of this is the "define _MSC_VER 1500" in pcapif.c:
   /* e.g. mingw */
   #define _MSC_VER 1500
   #include "pcap.h"
   #undef _MSC_VER

Bumping '_MSC_VER' to 1900 fixes this. But why are these lines needed?

--
--gv

_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: Building using MinGW

goldsimon@gmx.de
Gisle Vanem wrote:

> Trying to build lwIP using TDM-gcc 5.1.0 (MinGW), now produces
> this error:
>    In file included from f:/MingW32/src/inet/libpcap/pcap/pcap.h:74:0,
>                     from f:/MingW32/src/inet/libpcap/pcap.h:43,
>                     from contrib/ports/win32/pcapif.c:50:
>    f:/MingW32/src/inet/libpcap/pcap/pcap-inttypes.h:48:6: error: #error "Building libpcap
> requires VS 2015 or   later"
>         #error "Building libpcap requires VS 2015 or later"
>          ^
>
>
> The cause of this is the "define _MSC_VER 1500" in pcapif.c:
>    /* e.g. mingw */
>    #define _MSC_VER 1500
>    #include "pcap.h"
>    #undef _MSC_VER
>
> Bumping '_MSC_VER' to 1900 fixes this. But why are these lines needed?

Hmm, I really can't remember. Probably because the pcap sources I used at that
time did not work without defining it? I don't think mingw defines _MSC_VER, and
since the pcap headers do different things without it, this made it work.

But I'm not using mingw, so that #else case in pcapif.c is probably not used by
anyone right now. Feel free to get it compiling for you in the best way and
provide a patch :)

Regards,
Simon

_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: Building using MinGW

Gisle Vanem-3
Simon Goldschmidt wrote:

> But I'm not using mingw, so that #else case in pcapif.c is probably not used by
> anyone right now. Feel free to get it compiling for you in the best way and
> provide a patch :)

Guy Harris provided a patch in libpcap:
   https://github.com/the-tcpdump-group/libpcap/commit/0103d2880a8f6e78fe001fe35f8be958eeda81eb

I've not tried it.


--
--gv

_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: Building using MinGW

goldsimon@gmx.de


Am 18. Dezember 2019 21:58:34 MEZ schrieb Gisle Vanem <[hidden email]>:

>Simon Goldschmidt wrote:
>
>> But I'm not using mingw, so that #else case in pcapif.c is probably
>not used by
>> anyone right now. Feel free to get it compiling for you in the best
>way and
>> provide a patch :)
>
>Guy Harris provided a patch in libpcap:
>https://github.com/the-tcpdump-group/libpcap/commit/0103d2880a8f6e78fe001fe35f8be958eeda81eb
>
>I've not tried it.

That patch just undefs _MSC_VER seemingly only to break lwIP *and* contains really childish comments. I wouldn't try it as well :-)

But funny that it came so promptly after these mails here...

Again, mingw is of no interest to me personally. I'll happily accept patches, but don't expect any other work from me on that.

Regards,
Simon

_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: Building using MinGW

Giuseppe Modugno
In reply to this post by Gisle Vanem-3
Il 18/12/2019 11:42, Gisle Vanem ha scritto:

> Trying to build lwIP using TDM-gcc 5.1.0 (MinGW), now produces
> this error:
>   In file included from f:/MingW32/src/inet/libpcap/pcap/pcap.h:74:0,
>                    from f:/MingW32/src/inet/libpcap/pcap.h:43,
>                    from contrib/ports/win32/pcapif.c:50:
>   f:/MingW32/src/inet/libpcap/pcap/pcap-inttypes.h:48:6: error: #error
> "Building libpcap
> requires VS 2015 or   later"
>        #error "Building libpcap requires VS 2015 or later"
>         ^
>
>
> The cause of this is the "define _MSC_VER 1500" in pcapif.c:
>   /* e.g. mingw */
>   #define _MSC_VER 1500
>   #include "pcap.h"
>   #undef _MSC_VER
>
> Bumping '_MSC_VER' to 1900 fixes this. But why are these lines needed?
>
I have a project with lwip that compiles with mingw. I think you are
using a different version of pcap libraries. I vaguely remember I
couldn't be able to compile with an updated pcap library.

Indeed I don't have pcap-inttypes.h at all and pcap/pcap.h doesn't have
any reference to that file. I'm not using a globally installed pcap
libraries, pcap includes and libraries are "installed" in the project
folder. It seems I'm using Winpcap 4.1.2 (most probably this[*]).

[*] https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: Building using MinGW

Giuseppe Modugno
In reply to this post by goldsimon@gmx.de
Il 18/12/2019 22:11, goldsimon ha scritto:

>
> Am 18. Dezember 2019 21:58:34 MEZ schrieb Gisle Vanem <[hidden email]>:
>> Simon Goldschmidt wrote:
>>
>>> But I'm not using mingw, so that #else case in pcapif.c is probably
>> not used by
>>> anyone right now. Feel free to get it compiling for you in the best
>> way and
>>> provide a patch :)
>> Guy Harris provided a patch in libpcap:
>> https://github.com/the-tcpdump-group/libpcap/commit/0103d2880a8f6e78fe001fe35f8be958eeda81eb
>>
>> I've not tried it.
> That patch just undefs _MSC_VER seemingly only to break lwIP *and* contains really childish comments. I wouldn't try it as well :-)
>
> But funny that it came so promptly after these mails here...
>
> Again, mingw is of no interest to me personally. I'll happily accept patches, but don't expect any other work from me on that.

As I already wrote, I think the problem seen by Gisle can be solved
using a specific version of Winpcap. Are you using
Microsoft/VisualStudio compiler? Which Winpcap version are you using?

It seems Winpcap is an outdated and stopped project. The new project is
Npcap. Do you have any plan to fix the win32 contrib to Npcap?


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: Building using MinGW

goldsimon@gmx.de
Am 19.12.2019 um 11:17 schrieb Giuseppe Modugno:

> Il 18/12/2019 22:11, goldsimon ha scritto:
>>
>> Am 18. Dezember 2019 21:58:34 MEZ schrieb Gisle Vanem <[hidden email]>:
>>> Simon Goldschmidt wrote:
>>>
>>>> But I'm not using mingw, so that #else case in pcapif.c is probably
>>> not used by
>>>> anyone right now. Feel free to get it compiling for you in the best
>>> way and
>>>> provide a patch :)
>>> Guy Harris provided a patch in libpcap:
>>> https://github.com/the-tcpdump-group/libpcap/commit/0103d2880a8f6e78fe001fe35f8be958eeda81eb
>>>
>>> I've not tried it.
>> That patch just undefs _MSC_VER seemingly only to break lwIP *and* contains really childish comments. I wouldn't try it as well :-)
>>
>> But funny that it came so promptly after these mails here...
>>
>> Again, mingw is of no interest to me personally. I'll happily accept patches, but don't expect any other work from me on that.
>
> As I already wrote, I think the problem seen by Gisle can be solved
> using a specific version of Winpcap. Are you using
> Microsoft/VisualStudio compiler? Which Winpcap version are you using?
>
> It seems Winpcap is an outdated and stopped project. The new project is
> Npcap. Do you have any plan to fix the win32 contrib to Npcap?

Me? No. I'd welcome patches in that area, but my focus is on embedded
devices running lwIP. I run and debug it on Windows and Linux, but on
the Windows systems I use to debug it, I just use winpcap or npcap in
winpcap compatible mode for now. I don't want to afford the time
developing an npcap right now...

But as always: patches are welcome! (especially since I thought the pcap
driver could get portable but doesn't work on Linux/Unix anway)

Regards,
Simon

_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: Building using MinGW

goldsimon@gmx.de
Am 10.01.2020 um 23:23 schrieb [hidden email]:

> Am 19.12.2019 um 11:17 schrieb Giuseppe Modugno:
>> Il 18/12/2019 22:11, goldsimon ha scritto:
>>>
>>> Am 18. Dezember 2019 21:58:34 MEZ schrieb Gisle Vanem <[hidden email]>:
>>>> Simon Goldschmidt wrote:
>>>>
>>>>> But I'm not using mingw, so that #else case in pcapif.c is probably
>>>> not used by
>>>>> anyone right now. Feel free to get it compiling for you in the best
>>>> way and
>>>>> provide a patch :)
>>>> Guy Harris provided a patch in libpcap:
>>>> https://github.com/the-tcpdump-group/libpcap/commit/0103d2880a8f6e78fe001fe35f8be958eeda81eb
>>>>
>>>> I've not tried it.
>>> That patch just undefs _MSC_VER seemingly only to break lwIP *and* contains really childish comments. I wouldn't try it as well :-)
>>>
>>> But funny that it came so promptly after these mails here...
>>>
>>> Again, mingw is of no interest to me personally. I'll happily accept patches, but don't expect any other work from me on that.
>>
>> As I already wrote, I think the problem seen by Gisle can be solved
>> using a specific version of Winpcap. Are you using
>> Microsoft/VisualStudio compiler? Which Winpcap version are you using?

Oh, and I'm no using mingw at all. All I ever did was accepting patches
and maybe installing mingw in a VM and testing it compiles. I'm using
VisualStudio or cygwin, but not mingw...

Regards,
Simon

>>
>> It seems Winpcap is an outdated and stopped project. The new project is
>> Npcap. Do you have any plan to fix the win32 contrib to Npcap?
>
> Me? No. I'd welcome patches in that area, but my focus is on embedded
> devices running lwIP. I run and debug it on Windows and Linux, but on
> the Windows systems I use to debug it, I just use winpcap or npcap in
> winpcap compatible mode for now. I don't want to afford the time
> developing an npcap right now...
>
> But as always: patches are welcome! (especially since I thought the pcap
> driver could get portable but doesn't work on Linux/Unix anway)
>
> Regards,
> Simon
>


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel