VxWorks SDK header dependencies

I’m trying to migrate an app that was written for VxWorks 6.6 but I’m having some issues on the way.

I have a header file that uses “wdLib.h” to import “WDOG_ID”. This is giving me the next error:

error: unknown type name 'WDOG_ID'

I’ve checked the file “wdLib.h” and realized that the definition has been moved to “types/vxWind.h”. Therefore I’ve included the “vxWind.h” header but the problem persists.

I’m using a makefile. If I include the path where “wdLib.h” and “vxWind.h” are located I even experience more errors like:

error: unknown type name '_Vx_SEM_ID'
    _Vx_SEM_ID          condSemId;      /* Vx sem associated with */
error: unknown type name '_Vx_OBJ_HANDLE'; did you mean 'OBJ_HANDLE'?
typedef _Vx_OBJ_HANDLE  trace_id_t;

Could someone please give me a hand.

Hi @amigueti, welcome to the Wind River Labs forum!

The VxWorks SDKs use a compiler driver named wr-cc, along with its counterparts wr-ld, wr-ar, etc.

The watchdog API is available in kernel space, so the application will be a downloadable kernel module (DKM). Let’s start with this sample code and save it as test_wdog.c.

#include <vxWorks.h>
#include <wdLib.h>

VX_WDOG(myWdog);
WDOG_ID myWdogId;

STATUS test_wdog()
    {
    if ((myWdogId = wdInitialize (myWdog)) == NULL)
        return (ERROR);
    else
        return (OK);
    }

This source file will be compiled as:

wr-cc -dkm -mcmodel=kernel test_wdog.c -o test_wdog.out

test_wdog.out needs to be loaded on your target before calling its entry point routine.

E.g.

-> ld < test_wdog.out
-> test_wdog