Skip to main content
GameDev.net gamedev.net
🔒 Locked

Compiler error

Started by Hermes Jan 24, 2005 at 2:09 PM 11 replies 1.9k views
Original Post
Hermes
Hermes
These lines of code throw me an internal compiler error with my VisualStudio.NET #include #include using namespace std; Could you find a reason why ?
Staffan E
Staffan E
Please post code which is not compiling and the full compiler error.
Hack my projects! Oh Yeah! Use an SVN client to check them out.BlockStacker
choffstein
choffstein
lack of spacing, perhaps?
squirrelman3000
squirrelman3000
Every time I get an internal compiler error, it is because I #included a
file multiple times. Even if you use an include gaurd it can happen. Did you include another project file that #includes vector or string?
Hermes
Hermes
#include
#include
using namespace std;


class CBrick
{
public:
CBrick(){}
~CBrick(){}

HWND m_hWnd;
int value;
string name;


};
I stripped all my code and i get the same error even with that simple class that's the only thing related to
The error is :
fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'f:\vs70builds\9466\vc\Compiler\Utc\src\P2\main.c', line 146)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Palidine
Palidine
Quote:
Original post by Hermes
fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'f:\vs70builds\9466\vc\Compiler\Utc\src\P2\main.c', line 146)


are you sure that's all the code? it's complaining about something on line 146, but i don't see nearly that many lines there. i'm assuming that main.c is your file? also, and this isn't your problem but the cusom for C++ files is for them to be named .cpp not .c

-me
Palidine
Palidine
addendum:

here's some info on that compiler error, maybe this can help you sort it out:

http://www.kbalertz.com/kb_Q122042.aspx

the key takeaway would be:
Quote:

RESOLUTION
Avoid using /Zg with a large amount of header file information, such as the MFC class library headers.


-me
Drew_Benton
Drew_Benton
Try doing a "Build->Clean" then "Build->Rebuild All" sequence. You get that error when you have something that is so bad the parser cannot parse it and cannot recover from it. I've had that a few times. I was able to compile that snippet after adding #include and adding in int main(). Try creating another project with the same code and see if that works. I'm thinking something got corrupted and you just need to start fresh. If that does not work, you will need to post mroe code, for its something else that is making the parser error.

Here is a quick little example. One last tip is to just restart your computer a few times. I have read of people that did that and the problem was solved.

- Drew
Hermes
Hermes
I don't consider my error very bad since i stripped all my code to just include and it still throws me the same error.
But you're right a buildClean works perfectly but i still don't understand why?[looksaround]
Drew_Benton
Drew_Benton
Quote:
Original post by Hermes
I don't consider my error very bad since i stripped all my code to just include and it still throws me the same error.
But you're right a buildClean works perfectly but i still don't understand why?[looksaround]


Well I think it has to do with "incremental linking". Basically the extr space that is allocated to save compile time is overflowed with new data, so the files become corrupted, thus requiring a rebuild. I'm not 100% sure on that, but I do know it has to do with the corruption of the build files.
JohnBolton
JohnBolton
Your code shouldn't compile because "HWND" is undefined.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
lucinpub
lucinpub
I've had problems like that when I had c++ style includes ( ie #include ) in a .c file.
Lucas Henekswww.ionforge.com
Lazzar
Lazzar
Quote:
Original post by lucinpub
I've had problems like that when I had c++ style includes ( ie #include ) in a .c file.


Mr. lucinpub is right, happend me too a few times.

rename main.c to main.cpp and it should work.
---------------------------------------------------------if god gave us the source code, we could change the world!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.