I've moved the thread here, since it is more appropriate in this section
According to
this instruction you need to perform a few logistics, befor your program will work, like linking with a few libraries.
Since you didn't provide any info on what compiler/IDE you're using, I have no idear if the described steps here are, what you've missed out on, or if you'øve allready covered that.
I'm guessing you're using
this tutorial for your programming, since I see parts of your code as their examples.
But since you're not providing any otehr information, than the error, I'm stumped at teh moment, a compiler/IDE and the steps you've used up untill now, will provide a better angle from my perspective on this.