Morning, i have a problem with C++, i finished my algorithm and the following massage appeared:
undefined reference to 'WinMain'
[Error]id returned 1 exit status
And this is my algorithm:(Its very simple, in deed)
#include <iostream>
#include <locale>
using namespace std;
int dias, anos;
intmain ()
{
setlocale (LC_ALL, "ptb");
cout << "Informe a quantidade de dias que você já viveu \n";
cin >> dias;
anos = dias/365;
cout << "Você já viveu " << anos << "anos.";
The solution is similar, though. Make sure your IDE (Code::Blocks?) has your project listed as a (Native) Windows Console Application. Otherwise it will add -mwindows to the compiler’s command invocation and get you that error.