posted Sat 20-05-2006 13:57:55, in the c++ ( ) category
While being pretty much anti everything Microsoft does or releases, I'm usually a big fan of their C++ compiler. I don't really care about the often
heared argument from the open source world that VC++ doesn't support any C/C++ standard properly. It supports the standards I require good enough, and any portability
issues it may cause are more often than not solved in a few hours (in my experience, that is ;-)).
However, there's one aspect of the VC++ compiler that I absolutely despise. Everything is going according to plan, when all of a sudden you get
the following dreaded error message:
yourfile.cpp(17) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'f:\\vs70builds\\3077\\vc\\Compiler\\Utc\\src\\P2\\<SOMEFILE>',
line <SOME LINE>)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Getting this message means you're in Microsoft's hell. Welcome to the world where problems are solved in an entirely different manner. Googling
for the terms \"INTERNAL COMPILER ERROR C1001\" and then the \"<SOMEFILE>\" and \"<SOME LINE>\" terms yields results showing other poor suckers who had the
same problem, and most of the time (read: in every case) never got any solutions. You can mail Microsoft for 'support', but it won't get you anywhere. It seems
they are willing to acknowledge it's a (known) problem, but are totally unwilling to fix it. (How different is the gcc team in this,
read for yourself.)
During my time at Khaeon Games B.V. I've encountered internal compiler errors many times, and actually in every case I was able to fix the problem.
What follows is list of internal compiler error messages, and the solutions I found to solve them. The biggest tip I can give in advance
is:
When you get an internal compiler error in VC++, turn off Precompiled Header support for the file/project it's happening in!
This worked in +/- 30% of all cases I've ever seen. If this doesn't work for you, read on. I'm going to work on this table over a period of time, so its contents
will grow!
| Compiler file: p2symtab.c |
Line number: 4533 |
I got this error on a piece of code looking like this:
if (SomeExpression) {
SomeObj->SomeFunc( \"PlayerWalking\" );
}
Changing \"PlayerWalking\" into \"PlayerWalkin\" or \"PlayerWalking2\" stopped the ICE from happening, however, that was not the string I needed!
Creating a const char* variable containing that particular string and supplying that to the SomeFunc function
didn't solve the problem, as the ICE would occur on the line where I assigned the variable. This let to the clue that the compiler for
some reason seriously disliked the string \"PlayerWalking\". So I started searching all header files (it were a LOT, actually) and found
that in one particular (huge) header file, I had defined a class, and in it I had implemeted a function:
class SomeClass {
public:
function SomeFunc() {
static SomeClass SomeObject( \"PlayerWalking\" );
}
};
AHA! I moved the implementation of the function away from the header file and into a source file, and the ICE was gone. Did it make sense? No.
Did it work? Yes! It's just the way of the Microsoft I guess.
|
To be continued... -- Foddex
[ Back to blog listing ]
| More c++...20102009200820062005 |