You need to link in the gl libraries. I'm quite sure whatever tutorial you're using for this provides these instructions. Or perhaps not, because if you're unaware of how to link libraries, IMHO...