Nov 27, 2021 at 7:49am UTC
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
Nov 27, 2021 at 9:00am UTC
Probably missing a semicolon ; at the end of the class Entity
Nov 27, 2021 at 6:07pm UTC
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 Nov 27, 2021 at 6:14pm UTC
Nov 27, 2021 at 6:25pm UTC
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.
Nov 27, 2021 at 6:37pm UTC
Ohh i actually thought of that before but i didn't even try. Thanks
Last edited on Nov 27, 2021 at 6:37pm UTC