ridiculous errors

Started by
5 comments, last by stond 21 years ago
helo my program compiled just fine before, but now i get all 100+ rediculous errors, for example: class camera { private: //Camera vector location xyz GLfloat vector[3]; //Camera vector angles xyz GLfloat angle[3]; //Camera vector velocity variables GLfloat velocity[3]; public: GLfloat speedLimit; GLfloat acceleration[3]; camera() { vector[] = {0.0f, 0.0f, -20.0f}; angle[] = {0.0f, 0.0f, -0.0f}; velocity[] = {0.0f, 0.0f, 0.0f}; acceleration[] = {0.0f, 0.0f, 0.0f}; speedLimit = .5f; } }; Errors: C:\programming\opengl\environment\resources/cam.h(29) : error C2059: syntax error : '']'' C:\programming\opengl\environment\resources/cam.h(30) : error C2501: ''angle'' : missing decl-specifiers C:\programming\opengl\environment\resources/cam.h(30) : warning C4244: ''initializing'' : conversion from ''const float'' to ''int'', possible loss of data (repeates 2 more times)C:\programming\opengl\environment\resources/cam.h(31) : error C2501: ''velocity'' : missing decl-specifiers C:\programming\opengl\environment\resources/cam.h(31) : warning C4244: ''initializing'' : conversion from ''const float'' to ''int'', possible loss of data . . . . and so on and so on, it pretty much goes through all of my variables. These are the first errors that show up (included before winmain()). I''ve tried putting all of my header files into one .cpp but got the same errors, and my code worked fine before. I''m on MSVC++ v4.0.
Advertisement
speedLimit = .5f;

try...
speedLimit = 0.5f;

I''m not sure but i think....
-------------------------Knowledge Is For EveryoneSnowKing3kSnowKing3k@hotmail.com
nada, but my code looks more uniform now
You didn''t just recently add a "using namespace std" somewhere, did you?
to be honest I don''t know what that means, but to my knowledge i didn''t.
vector[] = {0.0f, 0.0f, -20.0f};

You can''t do that. Syntax error. You can only do this during initialization, i.e.

GLfloat vector[] = {0.0f, 0.0f, -20.0f};

so in the constructor ya gotta go
vector[0] = 0.0f;
vector[1] = ... so on and so on

This topic is closed to new replies.

Advertisement