Hi K. Frank,
Thanks a lot for pointing out the "need to wrap your declaration of the function CreateWellKnownSid ("the missing header codes") in an "extern "C"" block". That has fixed my problem!
 
I have checked again and notice the below in winbase.h 
 
#ifdef __cplusplus
extern "C" {
#endif
......
...
#ifdef __cplusplus
}
#endif

regards,
KL Lai