I managed to solve this problem.
The cause of this error was the missing headers in C compiler, 'stddef.h' . I use Microsoft Visual C++ 2015 pro. I added the headers and libraries and now it works fine.
Two lessons I learned here:
1) read the error message in full. it often provides the clue to identify and resolve the problem.
2) it is imperative that you are sure about your model accuracy and all the configurations of host- target is good. it would help to elimnate many possiblities during troubleshooting of the error message.