Hello,
I am trying to run the following program in Codeblocks:
Code:
#include <iostream>
using namespace std;
void Reverseds (double nums[], const int size)
{
int i;
double nums2[size];
for (i=0; i<size; i++)
{
nums2[i] = nums[size - i];
cout << nums[size - i] << " " << nums2[i] << "\n";
}
}
int Main ()
{
int size = 5;
double nums[] = { 1.77, 5.6, 7.8, 10.11, 12.3};
Reverseds (nums,size);
return 0;
}
I am getting this error when trying to build it
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(main.o):main.c.text+0x104): undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 0 warnings
I have looked up undefined reference to `_WinMain@16' on the internet and the two problems that it is usually associated with are:
1 - No Main () in the program. I have int Main () in my program
2 - The application type selected is the wrong type (not a console application). However, my application type is a console application.
Can someone tell me why this will not build?