How to change the scene?

I have two scripts. One for the main menu, and one for the intro. I am trying to use

auto mainmenu = MainMenu::createScene();
Director::getInstance()->replaceScene(mainmenu);

I am using #include "MainMenuScene.h"
MainMenuScene.h:

#ifndef __MENU_SCENE_H__
#define __MENU_SCENE_H__

#include "cocos2d.h"

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

    virtual bool init();
    
    void menuCloseCallback(cocos2d::Ref* pSender);
 
    CREATE_FUNC(MainMenu);
};

#endif

I don’t understand your question.

https://docs.cocos2d-x.org/cocos2d-x/v4/en/scenes/

Xcode is saying “Undefined symbol: MainMenu:createScene()” when I am trying to switch the scene to a new script

Does the scene get created? What does the debugger say when you step through?

what do you mean by “What does the debugger say when you step through”
sorry i’m actually quite new to xcode

Place a breakpoint before creation and then step in, step over and see what happens.

what is a breakpoint tho?

yes i know nothing about computers and coding and stuff

edit: nvm i did some research and found what a breakpoint is