lundi 4 décembre 2017

Getting an error while compiling and runing my c++ code using g++ compiler

I am using g++ compiler on linux os to compile and run a simple c++ program and i am getting this error on terminal:

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start': (.text+0x20): undefined reference to 'main' collect2: error: ld returned 1 exit status

Here is my code:

#include<iostream>
using namespace std;
int main()
{
    int x=0;
    cout<<x;
    return 0;
}

Aucun commentaire:

Enregistrer un commentaire