Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8563055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:52:19+00:00 2026-06-11T16:52:19+00:00

This may be hard to explain. I have been developing a program for about

  • 0

This may be hard to explain. I have been developing a program for about a month now in MS VisC++ 2010 express. I have had no strange problems and was ready to build my project for the 100th time when suddenly, many of the .cpp files seemed to loose contact with the .h files. For instance, in the main function, objects that I had created and used weeks ago, suddenly got the red line under them and the syntax error “theClass is undefined“. This applies to iostream, so suddenly cout is undefined. I have no idea what happened. One second to another all external header files and libraries suddenly disappeared in the eyes of the IDE. In the .cpp files, when I declare the class constructor

//initializes a poker game
aPokerGame::aPokerGame(void)
{
    stopPlaying = 'n';          
}

I get the line under the class name aPokerGame and this error is “must be a class or a namespace name“. Isn’t this what would be happen if the .h files disappeared? In fact, not all .cpp files are having this problem, only some. Others have really weird errors in them like “no default constructor exists for class”std::basic_ostream<wchar...“. All these errors appeared at once.

The header files seem fine. Though one of them has “Error: expected a declaration” under the “Private:” heading for the private members.

Please help!

Here is a sample of the compile errors:

1>—— Build started: Project: firstProj, Configuration: Debug Win32
—— 1> userPlayer.cpp 1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\userplayer.h(9):
error C2504: ‘Player’ : base class undefined 1>c:\program files
(x86)\microsoft visual studio 10.0\vc\include\iostream(10): error
C2059: syntax error : ‘namespace’ 1>c:\program files (x86)\microsoft
visual studio 10.0\vc\include\iostream(10): error C2334: unexpected
token(s) preceding ‘{‘; skipping apparent function body
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\userplayer.cpp(8):
error C3254: ‘Player’ : class contains explicit override ‘{ctor}’ but
does not derive from an interface that contains the function
declaration
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\userplayer.cpp(8):
error C2838: ‘{ctor}’ : illegal qualified name in member declaration
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\userplayer.cpp(8):
error C2535: ‘Player::Player(void)’ : member function already defined
or declared 1>
c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\player.h(18)
: see declaration of ‘Player::Player’
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\userplayer.cpp(13):
error C3254: ‘Player’ : class contains explicit override ‘{dtor}’ but
does not derive from an interface that contains the function
declaration
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\userplayer.cpp(13):
error C2838: ‘{dtor}’ : illegal qualified name in member declaration
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\userplayer.cpp(13):
error C2535: ‘Player::~Player(void)’ : member function already defined
or declared 1>
c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\player.h(19)
: see declaration of ‘Player::~Player’
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\userplayer.cpp(18):
error C3254: ‘Player’ : class contains explicit override ‘userBets’
but does not derive from an interface that contains the function
declaration
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\userplayer.cpp(18):
error C2838: ‘userBets’ : illegal qualified name in member declaration
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\userplayer.cpp(38):
fatal error C1075: end of file found before the left brace ‘{‘ at
‘c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\player.h(12)’
was matched 1> pokerRound.cpp
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\npcplayer.h(9):
error C2504: ‘Player’ : base class undefined
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\userplayer.h(9):
error C2504: ‘Player’ : base class undefined 1>c:\program files
(x86)\microsoft visual studio 10.0\vc\include\iostream(10): error
C2059: syntax error : ‘namespace’ 1>c:\program files (x86)\microsoft
visual studio 10.0\vc\include\iostream(10): error C2334: unexpected
token(s) preceding ‘{‘; skipping apparent function body 1>c:\program
files (x86)\microsoft visual studio 10.0\vc\include\time.h(35): error
C2059: syntax error : ‘string’ 1>c:\program files (x86)\microsoft
visual studio 10.0\vc\include\time.h(35): error C2334: unexpected
token(s) preceding ‘{‘; skipping apparent function body
1>c:\users\bn\dropbox\myprojects\mysoftware\c++\firstproj\firstproj\pokerround.cpp(16):
error C2059: syntax error : ‘namespace’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:52:20+00:00Added an answer on June 11, 2026 at 4:52 pm

    Probably you are missing a semicolon after a class definition or something like that in a header file which you #include into a bunch of other files above some standard header files, which makes everything mess up and the compiler report things as errors that are only errors because you forgot one little thing way up the line.

    Double check the syntax of each of your header files meticulously, looking for mismatching parentheses or braces, and making sure you have semicolons where they are needed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may have been asked before, but it's really hard to search for terms
This may be hard to explain, but I have array object like this: myobject
This may be a little hard to describe since I don't have a sample.
Before I start this may be hard for some people to understand. Sorry. I
This may be a stupid question but I have a code with the following
This may be have a better name than custom tab completion, but here's the
This may sound like a very generic question but here it goes. I have
Here is a hard one I have been trying to get it work. It
This may be a duplicate of some other question, but it's hard to search
This may be a little bit of a hard one to pin down exactly,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.