2026-02-24 12:52 PM - edited 2026-02-24 12:54 PM
Hello everyone,
I’m working on a project with an STM32H750B-DK board using TouchGFX and LWIP (Ethernet). After configuring LWIP in CubeMX and generating the code, I encountered a compilation error that took me a while to understand. I’d like to share the problem to help anyone who might run into the same issue.
In file included from ../Application/User/gui/NetworkTask.cpp:13:
../../TouchGFX/gui/include/gui/model/ModelListener.hpp:13:23: error: macro "bind" requires 3 arguments, but only 1 given
13 | void bind(Model* m)
| ^
In file included from ../Application/User/gui/NetworkTask.cpp:11:
../../Middlewares/Third_Party/LwIP/src/include/lwip/sockets.h:616: note: macro "bind" defined here
616 | #define bind(s,name,namelen) lwip_bind(s,name,namelen)
| Similar errors appeared for Model.hpp.
LWIP’s sockets.h defines a macro bind that replaces any occurrence of bind( with lwip_bind(s,name,namelen). This macro is intended to redirect the BSD bind() function to LWIP’s own implementation. Unfortunately, it also catches any other method named bind – in our case, the bind methods in the TouchGFX MVP classes (Model::bind(ModelListener*) and ModelListener::bind(Model*)). The macro expands them incorrectly, causing the compiler to complain about wrong arguments.
I hope this helps someone save time debugging this macro clash. Thanks to the community for the help!
Cheers,
Solved! Go to Solution.
2026-02-25 12:26 AM
Hello and thank you for the sharing.
I'm also adding this knowledge base: LwIP integration in a TouchGFX project: recommendations and pitfalls
I'm accepting that as solution for more visibility to other users..
2026-02-25 12:26 AM
Hello and thank you for the sharing.
I'm also adding this knowledge base: LwIP integration in a TouchGFX project: recommendations and pitfalls
I'm accepting that as solution for more visibility to other users..