Im trying to finish this calculator program, its for a writing rpg on a forum, for a post you get
line count
creativity rating
and difficulty rating
using these 3 things you use a special formula to find out the final power level, this code compiles ok, but when it builds it gives the following link errors:
'Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/calc.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.'

Heres the code, help appreciated:

#include <iostream.h>
#include <cstdio>
#include <cmath>
#include <string>

using namespace std;

int main()
{
        char name [100];
        char quit;
        quit ='\0';
        while (quit !='q')
        {
                system("title Average Calculator");
                system("color 84");
                float creat, diff, lines, pl, x, z; //loads integers into memory
                cout <<"This is a simple power level calculator"<< endl;
                cout<<"What is your characters name?"<< endl;
                cin.getline (name,100);
                cout<<"Hello, " << name << "."<<  endl;
				cout<<"Put in your current pl"<<endl;
				cin>> pl;
                cout<<"Put in your difficulty points:"<< endl; //asks for diff
                cin>> diff; //Receives difficulty and loads it into memory
                cout<<"Put in your creativity points:"<< endl;
                cin>> creat;
                cout<<"Put in your line count:"<< endl;
                cin>> lines;
                x = pl*(10*diff)+(10*creat)+(2*lines); //makes z integer equal to all grades added together (starting division equation)
                z = x/150*(lines*(pl/1.5)); //makes the x integer equal to z (to make me less frustrated)
                cout<<"Your average is " << x << ".\a"<< endl; //Outputs final divisional answer (all grades/5)
                cout<<""<< endl;
                cout<<"Q - Quit"<< endl;
                cout<<"R - Repeat"<< endl;
                cout<<"Please type in the corresponding letter for your choice then press enter."<< endl;
                cin>> quit;
                cout<<"Goodbye, " << name << "."<< endl;
                system("PAUSE");
                system("cls");
        }

        return 0;
}

Recommended Answers

All 3 Replies

Wow thats got it thanks lol

Um how thE f*** dEw yEw usE tiizZ s*** damn yEw effiin nErdzZ haha

commented: dont bump old threads. Please follow the rules +0
commented: Waste of everyones time with this nonsense -1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.