Jump to content
  • Advertisement
Sign in to follow this  
ShmeeBegek

Strange compilation errors with mingw

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

I've recently been getting too many INTERNAL COMPILER ERRORs with VC++ for my patience and so decided to try to switch to using mingw instead of the compiler that comes with VC++ (tried this before... but I finally found a descent alternative IDE as well). The problem that I get compiling my sources seems quite strange, I have the function:
inline v2 norm()
	{
		float l = length();
	>>>	return v2(x/l,y/l);
	
}

The line with the carrots (>>>) generates the error: error: no matching function for call to 'v2::v2(v2)' I have the constructors:
	inline v2(float ix,float iy){x=ix;y=iy;}
	inline v2(float *v){memcpy(&x,v,sizeof(float)*2);}
	inline v2(v2 &o){x=o.x;y=o.y;}

And this sort of thing always compiled with VC++ (of course it's not exactly standards compliant), so could someone point out my stupid mistake here? I've tried playing around with it for a while to no avail, and all help is greatly appreciated, ~SPH

Share this post


Link to post
Share on other sites
Advertisement
Maybe not answering your real question: about the Internal compiler errors: are you compiling source that you have one a network drive? Visual C++ seems unable to handle that, copy it to a local drive and your fine..

Share this post


Link to post
Share on other sites
Your copy constructor should take a reference-to-const:
inline v2(v2 const & o);


Enigma

Share this post


Link to post
Share on other sites
typename list<Character*>::iterator it;

iterator is a dependent name and therefore requires the typename keyword to disambiguate it.

Enigma

Share this post


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

  • 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!