LNK2001 Error

Hello All,

I wrote this program for a class, and I keep getting the LNK2001 error.

//This program will take input from a user file, read the input,
//and output the first word after the first three commas
//************************************************************

#include <fstream>
#include <iostream>
#include <string>

using namespace std;

int main()
{
ifstream inFile; //begin conversion function c_str
string fileName, //allow user name file
firstWord, //get word after first comma
secondWord, //get word after second comma
thirdWord; //get word after third comma

cout << "Input file name:" << endl; //user prompt
cin >> fileName;

inFile.open(fileName.c_str()); //open file convert c_str

cin.ignore(200, ','); //get words
cin.get(firstWord);
cin.ignore(200, ',');
cin.get(secondWord);
cin.ignore(200, ',');
cin.get(thirdWord);

cout << firstWord << endl //output
<< secondWord << endl
<< thirdWord << endl;

char exit_char; // temporary for input
cout << "\nPress any key and <enter> to exit \n";
cin >> exit_char; // Wait for key response before exiting

return 0
}

The error says "error LNK2001: unresolved external symbol _mainCRTStartup"

Any ideas?

Thanks!
I'd guess you are compiling as a CRT console project or something like that. Try creating an empty project and compiling the code there, or go into the settings and change it to native/standard/whatever C++.
Yeah, I figured that out as soon as I posted, lol, thanks!
Topic archived. No new replies allowed.