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 782043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:19:26+00:00 2026-05-14T20:19:26+00:00

I am working on a college project, where I have to implement a simple

  • 0

I am working on a college project, where I have to implement a simple Scrabble game.

I have a player class (containing a Score and the player’s hand, in the form of a std::string, and a score class (containing a name and numeric (int) score).

One of Player‘s member-functions is Score getScore(), which returns a Score object for that player. However, I get the following error on compile time:

player.h(27) : error C2146: syntax error : missing ';' before identifier 'getScore'
player.h(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
player.h(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
player.h(27) : warning C4183: 'getScore': missing return type; assumed to be a member function returning 'int'
player.h(35) : error C2146: syntax error : missing ';' before identifier '_score'
player.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
player.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Here’s lines 27 and 35, respectively:

Score getScore(); //defined as public
(...)
Score _score; //defined as private

I get that the compiler is having trouble recognizing Score as a valid type… But why? I have correctly included Score.h at the beginning of player.h:

#include "Score.h"
#include "Deck.h"
#include <string>

I have a default constructor for Score defined in Score.h:

Score(); //score.h

//score.cpp
Score::Score()
{
    _name = "";
    _points = 0;
}

Any input would be appreciated!

Thanks for your time,

Francisco

EDIT:

As requested, score.h and player.h:
http://pastebin.com/3JzXP36i
http://pastebin.com/y7sGVZ4A

  • 1 1 Answer
  • 1 View
  • 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-05-14T20:19:27+00:00Added an answer on May 14, 2026 at 8:19 pm

    You’ve got a circular inclusion problem – relatively easy to fix in this case.

    Remove the #include "Player.h" from Score.h.


    See this question for an explanation and discussion of what you’d need to do if Score actually used Player.


    As for the compiler errors you’re getting, that’s how Microsoft’s compiler reports the use of undefined types -you should learn to mentally translate them all into “Type used in declaration not defined”.

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

Sidebar

Related Questions

I am currently working on a simple Scrabble implementation for a college project. I
Ok, I'm working on a php college project, and I have to let students
I'm working on college project. I have to develop distributed computing system. And i
I am working on a project for a local college using MVC3. I have
i am working on a task scheduler applications as my college project, i have
I'm working on a simple mp3 player project with C# and the WMPLib library.
im working on a project about a web-based system. I have a form, i
I'm working on my very first project outside the college. I have two classes.
Hey, I'm a fresh out of college graduate. I'm working on a project that
I'm working on a map editor for my college project. And I had a

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.