linking files

I am getting an error when I am trying to link my 3 c++ files-- tut.cpp, extra.h, and extra.cpp. I get an error sayinging "undefined reference to winmain@16". If I add
int main(){}
to extra.cpp, my problem is solved, but when i try and call a function from a class in extra.cpp and extra.h, nothing happens when my code is executed.
If you need the code...
tut.cpp:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include "extra.h"

using namespace std;

int main()
{
    extra n;
    n.say();
    return 0;
    cin.get();
}

extra.h:
1
2
3
4
5
6
7
8
class extra
{


    public:

    void say();
};

extra.cpp:
1
2
3
4
5
6
7
8
#include "extra.h"
#include <iostream>
using namespace std;

void extra::say(){
    cout << "Hi!";
}
Topic archived. No new replies allowed.