I took this code from Andre LaMothe's Game Dev Series. The book is the Game Programming All-In-One by Bruno Miguel Teixeira de Sousa.
I can get this code to compile with the GNU g++ compiler, but the VC 6.0 compiler just won't do it. It give me a link error of:
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/IVA.exe : fatal error LNK1120: 1 unresolved externals
What kinda funny is that the code was written (according to the writer) with VC in mind.
Code:
#include <iostream>
using std::cout;
using std::endl;
void CalcIVA(long Money, double IVA = 0.17);
int main()
{
cout << "Specifying the IVA value: $1000\n";
CalcIVA (1000, 0.12);
cout << "Using default IVA value: $1000\n";
CalcIVA (1000);
return 0;
}
void CalcIVA(long Money, double IVA)
{
double MoneyWithIVA;
MoneyWithIVA = Money * IVA;
cout << "Money after IVA at " << IVA << " is " << MoneyWithIVA << endl;
}
Is there something wrong with the code, or is there something wrong with my VC 6.0 setup?
Thanks.