0

So I have stumbled across another problem. This time I'm using freeglut I have put the lib files, dll, and include files where they should go in visual studio. Made a project and linked the lib files in it but i still cant initialize glut using glutInit. Here's what I got so far:

#include <GL/glew.h>
#include <GL/glut.h>

int main (int argc, char **argv) {
}

glutInit(&argc,argv);

glutInit says: This declaration has no storage class or type specifier
argc says: identifier argc is undefined

If anyone could point me out in the right direction that would be great as I have stumbled across problems the whole day and I would like at least make a window today.

2
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by MattyRobot
0

it might be because glutInit is outside of main?
(if that's how your actual code looks)

Edited by MattyRobot: n/a

0

Im guessing something wrong with the header file where it is defined? I just copy pasted the ones that comes with freeglut to the include/GL folder so got no idea what could be wrong other than a corrupted file in there maybe.. going to try another download and replace them.

0

thx for your reply gonna try that now im just starting out with this so lets give it a shot :)

0

OMG perfect thanks so much!! weird thing is that the guid im following puts it outside weirdd hehe better change guide hehe thanks again.

0

putting it outside of main() means that it isn't called when the program is run.
and I think the errors happened because the function uses argc and argv which are not in the global scope (they can only be used inside main())

well thats my guess anyway :)

Edited by MattyRobot: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.