Class pointer weird ass error

Entity* entity;

C2238 unexpected token(s) preceeding ';'
C2413 syntax error : missing ';' before '*'
C4430 missing type specifier - int assumed. Note: C++ does not support default-int
Probably missing a semicolon ; at the end of the class Entity
Probably missing a semicolon ; at the end of the class Entity

Or at the end of line preceding the one you showed us.
I won't show includes,variables,functions etc.

Entity.h

1
2
3
4
5
6
7
8
9
10
11
#pragma once
#include "MainWindow.h"

class Entity
{
private:

public:
	Entity();
      ~Entity();
};


MainWindow.h
1
2
3
4
5
6
7
8
9
10
11
12
#pragma once
#include "Entity.h"

class MainWindow
{
private:

	Entity* entity;
public:
	MainWindow();
	~MainWindow();
};


Edit : btw it's a post build error
Last edited on
You have recursive includes.

entity.h includes mainwindow.h and mainwindow.h includes entity.h.
You can't do that.

Remove the include of mainwindow.h from entity.h.
entity.h doesn't need it.

Ohh i actually thought of that before but i didn't even try. Thanks
Last edited on
Topic archived. No new replies allowed.