Original Post
🔒 Locked
unexpected class??
Advertisement
looks like two things:
- you''re defining the files to use pre-compiled headers, but your pre-compiled header is not the first #include in the file.
- you might be calling your files something.c, which makes MSVC compile them as C files, not as C++ files. Rename them something.cpp.
- you''re defining the files to use pre-compiled headers, but your pre-compiled header is not the first #include in the file.
- you might be calling your files something.c, which makes MSVC compile them as C files, not as C++ files. Rename them something.cpp.
sounds like your trying to define a class before including the PreCompiled Header
ie make sure that the first line of code in all your cpp files is
#include "StdAfx.h"
that should do the trick!!
Paul.
Edited by - Spider_In_A_Web on October 30, 2001 11:33:34 AM
ie make sure that the first line of code in all your cpp files is
#include "StdAfx.h"
that should do the trick!!
Paul.
Edited by - Spider_In_A_Web on October 30, 2001 11:33:34 AM
I got this exact message a couple days ago, and it turned out to be caused by a missing semi-colon, of all things. I know VC++ has a habit of issuing error messages that aren''t related to the actual error, so it may just be me...
''Nuff said. I''ll enjoy watching you live, demon.
''Nuff said. I''ll enjoy watching you live, demon.
Sorry to revive an old thread, but this problem has been bugging me lately, and I hope some more light can be shed upon it. I get the same "unexpected class" error, but this time it''s in the header, not the source. I have no errors before this one, and for some reason, even when I only include the h file once (with multiple inclusion guards), it still gives me "unexpected class"
Erm.. what if I don''t have any "StdAfx.h" file?
Anyway, what on earth could the problem be? I declare my class like this:
class CRenderer
{
stuff
};
so what is so Unexpected about it?
Anye help would be appreciated,
freshya
quote:
Spider_In_A_Web
make sure that the first line of code in all your cpp files is #include "StdAfx.h"
Erm.. what if I don''t have any "StdAfx.h" file?
Anyway, what on earth could the problem be? I declare my class like this:
class CRenderer
{
stuff
};
so what is so Unexpected about it?
Anye help would be appreciated,
freshya
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement