Hi all, I am a complete noob when it comes to programming but anyway, I am writing a program for class that calculates Net pay from Gross Pay after deductions. The program is suppose to save all input data to an outside file but there is no data being input from an outside source. I keep getting this error code
1>Build started 2/17/2012 12:43:39 PM.
1>InitializeBuildStatus:
1> Touching "Debug\MonthlyPayCheck.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Users\Sleek Super Beast\Documents\Visual Studio 2010\Projects\MonthlyPayCheck\Debug\MonthlyPayCheck.exe : fatal error LNK1120: 1 unresolved externals
I am using Microsoft Visual Studio 2010 here is the code I have written:
outFile << " Enter Full Name: ";
cin >> FullName;
outFile << endl;
outFile << setprecision (2); // setprecision to 2 for the rest of the document unless otherwise specified
outFile << " Enter Gross Amount: ";
cin >> GrossAmnt;
outFile << endl;
As a general rule, whenever I get an "unresolved symbol" dealing with anything, I check to see if the thing I'm referring to actually exists. Try this:
1 2 3 4
if(outFile.bad()){
cerr << "Unable to open file for writing!" << endl;
return 1;
}
Thanks! Apparently the project I was using it under was bugged. Anyway I have a new issue with the same program, it won't actually do any of my calculations, when I debug it all that appears is a black blank screen, I input two things and it prompts me to press any key to continue and closes. How do I get the program to perform the way I want it too?
Looks like it's doing what you told it to. You don't have any output to the terminal, only to the file. Look inside the file and see what you have in there. ;)