Forum Discussion
Altera_Forum
Honored Contributor
21 years agoC++ example
Hi everyone, I was wondering if there comes an C++ example for the lightweight ip stack with NIOSII ? I only see c examples, but if i want to extend them with C++ it won't work because of t...
Altera_Forum
Honored Contributor
21 years agoThere should be no problem with calling the LWIP C functions from C++. The only thing you have to ensure is that function prototypes are declared to be external C functions.
The easiest way to do this is to wrap the include for the LWIP files in an extern "C" decleration, e.g.: extern "C" {# include "lwip/sys.h"# include "lwip/netif.h"# include "lwip/sockets.h" }; Other than that, everything should work fine.