network-demos/netdemo build errors - and possible fixes

Morgan, Keith S morgank at
Fri May 24 21:54:51 UTC 2019

When trying to build the network-demos/netdemo example (see for RTEMS 5 (i.e. latest from git) we get the following two errors:

#1 - Error (output abbreviated for clarity)
init.c:31:3: warning: implicit declaration of function 'printk'; did you mean 'printf'? [-Wimplicit-function-declaration]
bspIo.h:115:12: error: conflicting types for 'printk'

#1 - Fix
We believe the fix for this error is to add the following include to netdemo/init.c: #include <rtems/bspIo.h>

#2 - Error (output abbreviated for clarity)
After fixing error #1 we configured the common networkconfig.h to use an actual interface* (rather than the default loopback) and get the following errors:
librtemsbsp.a(greth2.o): in function `greth_initialize_hardware':
bsps/shared/net/greth2.c:329: undefined reference to `_Timespec_Set_to_zero'
bsps/shared/net/greth2.c:339: undefined reference to `_Timespec_Greater_than'

#2 - Fix
We believe the fix for this error is to add the following include to bsps/shared/net/greth2.c: #include <rtems/score/timespec.h>, as we first reported here:

Keith Morgan &
Sam Larsen

*For example, we configured a network interface for a local subnet as follows...

static struct rtems_bsdnet_ifconfig netdriver_config = {
        RTEMS_BSP_NETWORK_DRIVER_NAME,          /* name */
        RTEMS_BSP_NETWORK_DRIVER_ATTACH,        /* attach function */
        NULL,                           /* No more interfaces */
        "",                  /* IP address */
        "",                /* IP net mask */

struct rtems_bsdnet_config rtems_bsdnet_config = {

Keith Shearl Morgan
ISR-3, Space Data Systems
Los Alamos National Laboratory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list