Xcode not compiling my code but other compilers like viscid are compelling it

#include <iostream>

//#include "Cat.h"

//#include "Cat.cpp"

using namespace std;



class Cat{



    private:

        bool happy;



    public:

        void speak();

        void makeHappy();

        void makeSad();

};



void Cat::speak(){

    if(happy){

        cout << "meoww!!!" << endl;

    }

    else{

        cout << "HHHHHHHH" << endl;

    }

}

    

void Cat::makeHappy(){

    happy = true;

}

void Cat::makeSad(){

    happy = false;

}



int main() {

    Cat jim;

    jim.makeHappy();

    jim.speak();



    Cat chomu;

    chomu.makeSad();

    chomu.speak();

    return 0;

}



someone please help
I created a macOS Command Line Tool project with Language: C++, and copied your code into main.cpp.
And it compiled without any issues.

What have you done with Xcode? Please clarify.
Xcode not compiling my code but other compilers like viscid are compelling it
 
 
Q