请问这个C++代码哪里写的不对

两数相加,运行的时候显示下面的情况
图片说明

helloworld.cpp

#include<iostream>
#include "hello.h"
using namespace std;
int main()
{       
    sum m(1,2);
}

hello.h

#ifndef MYTIME1_H_
#define MYTIME1_H_
class sum{
    private:
        int x;
        int y;
    public:
        sum();
        sum(int a,int b=0);
        void add();
};
#endif

hello.cpp

#include <iostream>
#include "hello.h"
using namespace std;
sum::sum()
{
    x=y=0;
}
sum::sum(int a,int b)
{
    x=a;
    y=b;
}
void sum::add()
{
    cout<<"the sum is "<<(x+y);
}

你这个是C++代码,但是用了C编译器在编译。得用g++编译。