How can I resolve this issue?

Please review the Forum Posting Guidelines for suggestions on what to include in a post so that it is more likely to get you helpful answers.

With the information you have provided it is difficult to say more than “your code has a bug”. Try using a debugger to determine where exactly your code crashes.
It looks like your code is attempting to dereference a null pointer. Purely guessing I suspect your problem could be related to initializing OpenGL function pointers, see Getting Functions on the wiki.