Advertisement Jump to content
Sign in to follow this  

Structure Overloading

This topic is 4928 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

hey again why do i get ?? [Linker error] undefined reference to `VEC::VEC(float, float, float) here is my code
struct VEC   {
   FLOAT x,y,z;   
   VEC() {};
   VEC( FLOAT x, FLOAT y, FLOAT z );

VEC vec;

vec = VEC(0,0,0); // gives the linker error vec2 = D3DXVECTOR3(0,0,0); // works gr8 and i tryed to copy there structure into // min but its still fails , what does MICROSOFT that i doesnt?? [/source]

Share this post

Link to post
Share on other sites
Well, Microsoft actually implemented the constructor. You did not. ;)

VEC(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {};

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!