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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:06:26+00:00 2026-06-06T12:06:26+00:00

My problem is pretty common I know but I’ve been searching and trying every

  • 0

My problem is pretty common I know but I’ve been searching and trying every solutions I found and still does not work. So any help would be greatly appreciated! =)

Thanks in advance!

I have this error at compilation :

g++ -ISFML/include -Iclasses/ -W -Wall -Werror   -c -o classes/Object.o classes/Object.cpp
In file included from classes/Core.hh:18:0,
         from classes/Object.hh:4,
         from classes/Object.cpp:1:
classes/MapLink.hh:9:1: error: invalid use of incomplete type ‘struct Object’
classes/MapLink.hh:6:7: error: forward declaration of ‘struct Object’
In file included from classes/Core.hh:19:0,
         from classes/Object.hh:4,
         from classes/Object.cpp:1:
classes/Player.hh:9:1: error: invalid use of incomplete type ‘struct Object’
classes/MapLink.hh:6:7: error: forward declaration of ‘struct Object’
make: *** [classes/Object.o] Error 1

So basically, I’ve got a main containing (main.cpp)

#include "Core.hh"

int        main(void)
{
  ...
}

Here’s the header file containing all my includes (Core.hh)

#ifndef __CORE_HH__
# define __CORE_HH__

#include ...
#include "Object.hh"
#include "MapLink.hh"
#include "Player.hh"

class Core
{
  ...
};

#endif /* __CORE_HH__ */

And then the files that are causing me troubles (Object.hh)

#ifndef __OBJECT_HH__
# define __OBJECT_HH__

#include "Core.hh"

class Object
{
  ...
};

#endif /* __OBJECT_HH__ */

(MapLink.hh)

#ifndef __MAPLINK_H__
# define __MAPLINK_H__

#include "Core.hh"

class Object;

class MapLink : public Object
{
  ...
};

#endif /* __MAPLINK_H__ */

(Player.hh)

#ifndef __PLAYER_H__
# define __PLAYER_H__

#include "Core.hh"

class Object;

class Player : public Object
{
  ...
};

#endif /* __PLAYER_H__ */
  • 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-06T12:06:27+00:00Added an answer on June 6, 2026 at 12:06 pm

    Problem #1:
    You must derive only from a fully declared class, otherwise the compiler wouldn’t know what to do.
    Remove the forward declaration class Object;.

    Problem #2:
    You have a circular dependency all over:

    • In “Core.hh” you include “Object.hh”, “MapLink.hh” and “Player.hh”.
    • In “Object.hh”, “MapLink.hh” and “Player.hh” you include “Core.hh”.

    You need to make sure the each class fully includes the class that it inherits from.
    I’m not sure how the classes interact with each other, you should provide that detail in the question.
    My guess is that you need to modify your inclusions as follows:

    • Modify “MapLink.hh” and “PlayerLink.hh” so that they include “Object.hh”, not “Core.hh”
    • Modify “Object.hh” so that it doesn’t include “Core.hh”.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this must be a pretty common problem, but I haven't been able
I know this is a pretty common problem but any of the solutions I
I do not know how common this problem is for other users, but for
I think this is a pretty common scenario, but I haven't been able to
I feel like this is a pretty common problem but I wasn't really sure
My problem is pretty common. I want to show some loading stuff while the
I have a pretty basic problem but I can't seem to figure it out...
I'm having a pretty big problem trying to create navigation on my page. If
I think this is a pretty common problem. I've got a table user(id INT
I am trying to solve a problem in Objective-C, but I don't think the

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.