might I know on which version of RIOT you are? I just checked adding USEMODULE += gcoap to tests/lwip on current master and the 2020.10 release and it compiled like a charm (so it is safe to assume it will also work for the upcoming 2021.01 release). gcoap used to be incompatible to other stacks than GNRC, but this was fixed in the past year. Not sure, but you might need to add an lwIP-specific branch to the gcoap dependencies here for gcoap to actually work (adding lwip_sock_async should do the trick). I’d happily ACK a PR, if that’s the case :-).
Thank you for the hint, I was on Version: 2020.10-devel-328-g4f54c-HEAD.
Now I updated to the current master2021.04-devel-443-gd6e43 and it works.
Adding lwip_sock_async was not necessary and seemed not to change anything.
But I had to remove these modules which usually are included in the gcoap example:
since there was a very similar error to the one mentioned above, but with other suggested types.
Now the ifconfig command is not available anymore, which is adverse for getting the IPv6 address of the CoAP server.
Nevertheless I was able to get a response via coap-client.
The lwIP test provides an ifconfig command as well, but that one is not available although I added all the modules from the lwIPMakefile to my gcoap example. I don’t know why that’s the case.
Unfortunately there occurred another problem:
In function ‘_parse_endpoint’:
…/gcoap_cli.c:235: undefined reference to ‘gnrc_netif_numof’
…/gcoap_cli.c:237: undefined reference to ‘gnrc_netif_iter’
…/gcoap_cli.c:245: undefined reference to ‘gnrc_netif_get_by_pid’
I simply disabled the gcoap_cli in my code, since I do not necessarily need it for my stuff and as I said, the CoAP server was running well without it.
Anyway, shall I open a new topic for this problem?