Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

stond

ridiculous errors

This topic is 5658 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You didn''t just recently add a "using namespace std" somewhere, did you?

Share this post


Link to post
Share on other sites
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};

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
so in the constructor ya gotta go
vector[0] = 0.0f;
vector[1] = ... so on and so on

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!