Sign in to follow this  
MTclip

stange compilation error - that goes away and comes back!!

Recommended Posts

using msv c++ 2003 here is the error error C2061: syntax error : identifier 'CConsole' this is the line it complains about HRESULT draw(CConsole * pConsole); this code works ... it came up when i was not even working on the class that has this code... i have not touched any of the code in this class.. 1.the program does not compile and gives the above error 2.if i comment out this function .. it compiles (-minus the functionality of the ..umm function) 3.then if i uncomment the line the program will compile and work.. 4. if i do a clean - rebuild it doesnot compile... (repeat steps above) why would it do this.. i dont understand... anyone?

Share this post


Link to post
Share on other sites
The problem is that the compiler doesn't know what a "CConsole" is. You need to declare it in the file before it is used (either a full or forward declaration), or include the header file where it is declared.

Share this post


Link to post
Share on other sites
Sounds like a compiler bug. Disable incremental compilation / linking on your compiler.

If it stil fails after you do a "clean", disable incremental compilation, close down your tool, manually remove any intermediate files, then do a totally clean build, then there is a bug in your source.

I assume that there is a bug here in the compiler which is causing incorrect code to be accepted because it (incorrectly) thinks it hasn't changed.

You aren't working on a network drive by any chance, and have the network server without its clock correctly synchronised?

If so, get your sysadmin to synch the clocks of all development machines & servers, as soon as possible.

Mark

Share this post


Link to post
Share on other sites
I really doubt it's a compiler bug. It sounds to me like you're using precompiled headers and your code is screwed up such that some files won't compile if the precompiled headers aren't built. This is a relatively common problem.

Share this post


Link to post
Share on other sites
Ahh..

thanks a lot got it to work as it should

just had to add a forward declaration of the CConsole class...
so strange.. it would all of a sudden need that

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this