Jump to content
  • Advertisement
Sign in to follow this  
Endar

fatal error - compiler error

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

Try and compile this on VC++ 6. This is the essence of some code I was writing, and I had forgotten to add the template to the inheritance part of inheriting from class A. Being a good little boy, I had everything properly encapsulated within namespaces.
namespace hello{

template <class T>
class A
{
public:
	int a;
};

}// namespace hello


class B	:	public hello::A
{
public:
	int b;
};

int main()
{

return 0;
}



Answer me this: why is it that if I get rid of the namespace I get a nice "class A is a template class!" error message, but if I put the namespaces in I get:
--------------------Configuration: test code - Win32 Debug--------------------
Compiling...
test code.cpp
C:\Documents and Settings\Naim\My Documents\Programming\everything\test code\test code.cpp(25) : fatal error C1001:
			 INTERNAL COMPILER ERROR
        (compiler file 'msc1.cpp', line 1786) 
         Please choose the Technical Support command on the Visual C++ 
         Help menu, or open the Technical Support help file for more information
Error executing cl.exe.

test code.exe - 1 error(s), 0 warning(s)
That? Why does the namespace cause such an error? Is it simply because VC++ 6 is really really broken?

Share this post


Link to post
Share on other sites
Advertisement
The code above should return error error C2955: 'hello::A' : use of class template requires template argument list. I'll try this in VS 2003.

[Edit]: In VS 2003 I've got no INTERNAL COMPILER ERROR.

Share this post


Link to post
Share on other sites
It's really strange. I only get the internal compiler error if I have the namespaces in. Take them out, perfectly legit "'A' : use of class template requires template argument list"

Isn't that just strange?

Share this post


Link to post
Share on other sites
It is not. That's why you've got VS 2003 and now VS 2005 published. I've crushed with some stranger behaviors of VS6: In the same Debug build, the program behaves differently when I run it from Visual Studio environment and when I run it from outside (by command line or Windows Explorer) with the same set of input.

Share this post


Link to post
Share on other sites
Quote:
Original post by Endar
So this is basically just another demonstration of VC++ 6 being really really broken.


exactly.

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!