Why can’t I do this?
#include <gl/gl.h>
GLfloat posX;
posX=0.0f;
Visual Studio says:
error C4430: missing type specifier –
int assumed. Note: C++ does not
support default-int
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The text
is at global scope, so is treated as a declaration, not a statement. Consider:
Then posY, posZ compile fine, but posX shows the issue. Note the issue is nothing to do with GL; you’ll get it if you replace GLfloat with plain old float.