error message:error LNK2001: unresolved external symbol _mainCRTStartup

// preprocessor directives----
#include <iostream> // for program input & output
#include <string> // for string class data
#include <iomanip> // for formatting output
using namespace std;

/* Function: main() *************************************************
*
* application entry point
*/
int main()
{




/* declarations ***********************************************
declare program data
*/
string name; // contributor's name
int targetContribution; // target contribution amount to the dollar
int actualContribution; // actual contribution amount made to the dollar
int difference; // calculated difference of the target and actual contributions






/* statements *************************************************
code program instructions: will ask for contribution target and actual amount. Will take the
difference of the target and actual amount and display it.
*/

//
// display program headings
//
cout << "Project/program name:U01_BelowTargetReport" << endl;
cout << "by" << endl;
cout << "Joe Blough" << endl;


// enter program loop (do while)
do
{


//
// Step #1: input
//
cout << "Enter Contributors name: "; //ask for contributor's name
cin >> name;

cout << "Enter target contribution: "; //ask for target contribution
cin >> targetContribution;

cout << "Enter actual contribution: "; //ask for actual contribution
cin >> actualContribution;

//
// Step #2: processing
//
difference = targetContribution - actualContribution; // calculate the difference between actual contribution
// and assign the number to difference



//
// Step #3: output
//



// display the report column headings
// format & print column heading row

cout << "Name Target Actual Difference" << endl;
cout << "----------------------------" << endl;

// display the report detail line
// 1 - format & display user name
cout << left; // justification
cout << setw(10); // width for column data
cout << name; // name of contributor

// 2 - format & display target contribution
cout << right; // justification
cout << setw(6); // width for column data
cout << targetContribution; // target contribution amount



// 3 - format & display actual contribution
cout << right; // justification
cout << setw(10); // width for column data
cout << actualContribution; // target contribution amount



// 4 - format & display difference
// note: positive number means target met
cout << right; // justification
cout << setw(14); // width for column data
cout << difference; // target contribution amount




// see if the user wants to continue or to exit the program

cout << "More contributions to process? (y/n): ";
cin >> choice;

cout << endl << "..........................." << endl;


// end of program loop;
// perform application until choice isn't equal to "y" or "Y"
} while (choice == "y" || choice == "Y");




//
// program termination
//
// main() program termination (required in all programs)
cin.ignore();
cin.get();

return 0;
}


error message: Error 1 error LNK2001: unresolved external symbol _mainCRTStartup J:\rvc 276\CIS276\27602_IntroToCPP\U01_BelowProjectReport\LINK
that's usually because you choose the wrong project type.
So you need to create a new project where you need to make sure that it is actually a console project
You don't really need to start a new project. Just go to project settings, linker settings, then system and change subsystem to "not set". It will link based on which entry point function you have defined.
Topic archived. No new replies allowed.