Virtual function inheritance problem

Hi, sorry to bother you again with what appears to be a noob question but I can’t seem to be able to solve the problem. So, I’m trying to subclass the layer class and subclass that class as well.
class Main:Layer and then Game:Main

The problem that I have is an error with the virtual init() function that looks something like this: error LNK2019: unresolved external symbol “public: virtual bool __thiscall Main::init(void)” (?init@Main@@UAE_NXZ) referenced in function “public: virtual bool __thiscall Game::init(void)” (?init@Game@@UAE_NXZ)

The source code looks like this:
Main.h

include "cocos2d.h"

class Main : public cocos2d::Layer
{
public:
	virtual bool init();  
};

Main.cpp:

include "Main.h"
USING_NS_CC;
bool Main::init()
{
    if ( !Layer::init() )
    {
        return false;
    }
    CCLOG("Main::init");
    return true;
}

Game.h

include "Main.h"

class Game : public Main
{
public:
    static cocos2d::Scene* createScene();

    virtual bool init();  
    void onEnterTransitionDidFinish();
    void onEnter();

    CREATE_FUNC(Game);
}

Game.cpp

    include "Game.h"
    
    USING_NS_CC;
    
    Scene* Game::createScene()
    {
        auto scene = Scene::create();
        auto layer = Game::create();
        scene->addChild(layer);
        return scene;
    }
    
    bool Game::init()
    {
        if ( !Main::init() )
        {
            return false;
        }
    	CCLOG("Game::init");
        return true;
    }
// and the implementation of the other functions goes here...

So what am I doing wrong?

I managed to make it work, same code, just deleted the files from the project and re-added them. Also I changed the name of the Main class, I don’t know if that mattered.

You don’t have to make your init virtual btw, unless you’re planning on adding a class that inherits from Game and should be able to overwrite it’s init() as well…

Yeah, I know that it’s not a must to have the init function virtual, but I also tried with not virtual functions and had the same problem, but apparently it was a Visual Studio problem not a coding one.