Why is complier showing (.text+0x20)||undefined reference to `main'|?

I've written the following program.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<iostream>
#include<sstream>
#include<string>

using namespace std;

int mian()
{
    string s;
    getline(cin,s);
    istringstream iss(s);
    vector<string>v;
    while(iss)
    {
        string val;
        iss>>val;
        v.push_back(val);
    }

    for(auto i:v)
        cout<<i<<endl;

    return 0;
}


When I ran this program into codeblocks it showed compilation error "/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' collect2: error: ld returned 1 exit status"

I am using Ubuntu 14.04 64bit.
Last edited on
You misspelled 'main' on line 7
Topic archived. No new replies allowed.