← index #6463PR #17915
Likely Duplicate · medium · value 0.314
QUERY · ISSUE

Using LWIP on Windows

openby gvanemopened 2020-09-21updated 2024-09-13
port-windows

First off, building MicroPython with MSVC and the ports/windows/micropython.vcxproj was exceptionally easy. Good job!

But when trying to add support for LwIP with:

  • -DMICROPY_PY_LWIP=1
  • -DMICROPY_ENABLE_SCHEDULER=1
  • Add extmod/modlwip.c and lib/netutils/netutils.c.

And trying to figure out where to add that in the .vcxproj files was not so easy. So I hacked up my own GNU-makefile.
And then getting to the link stage, I got this error:

lwip32.lib(sys_arch.obj) : error LNK2005: _sys_arch_protect already defined in MicroPython.lib(modlwip.obj)
lwip32.lib(sys_arch.obj) : error LNK2005: _sys_arch_unprotect already defined in MicroPython.lib(modlwip.obj)

Is there another define that should be set to avoid this? Adding -DNO_SYS=1 did not help.

Or are we supposed to link with a dynamic LwIP import-library? Since that works.

CANDIDATE · PULL REQUEST

extmod/modlwip: Remove unused include and functions.

mergedby tpwrulesopened 2025-08-13updated 2025-08-16
extmod

<!-- Thanks for submitting a Pull Request! We appreciate you spending the
time to improve MicroPython. Please provide enough information so that
others can review your Pull Request.

 Before submitting, please read:
 https://github.com/micropython/micropython/blob/master/CODEOFCONDUCT.md
 https://github.com/micropython/micropython/wiki/ContributorGuidelines

 Please check any CI failures that appear after your Pull Request is opened.

-->

Summary

<!-- Explain the reason for making this change. What problem does the pull request
solve, or what improvement does it add? Add links if relevant. -->
The lwipopts.h is now port-specific.

The sys_arch_{,un}protect functions are not used according to line 34 of extmod/lwip-include/lwipopts_common.h.

Neither have been touched in nearly a decade.

Testing

<!-- Explain what testing you did, and on which boards/ports. If there are
boards or ports that you couldn't test, please mention this here as well.

 If you leave this empty then your Pull Request may be closed. -->

Ensured that W5500-EVB-Pico builds and the resulting binary is unchanged.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied