I have NEVER had this experience before while coding my past assignments. For some reason, I keep getting this error that says

error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

.

I looked it up on google and people have been saying it's because I should've created a windows APPLICATION program instead of a windows CONSOLE. BUT THEY ARE WRONG! I've ALWAYS done windows console and this has NEVER popped up! Why is this happening to me?! This is my final project and I can't even get started because of this error!

I've TRIED creating a windows APPLICATION program and copy/pasted the same source code/header files and tried building it, BUT a different error pops up then. So I looked up that error on google and people have been saying that it's because I haven't created a windows CONSOLE application! So these errors keep putting me in circles!!!

How do I get rid of this stupid error?! Please help.
To explain in detail here's what I did to create this project:
1) Create a windows console application >> empty project
2) Created a new header file and pasted in the appropriate code from a different header
3) Created a new source file and pasted in the appropriate code from a different source
**I did save and move these files to its appropriate places, yet the error still occurs.

Here is my header and implementation code (I have more but I wanted to see if these two could even build correctly--and they can't)

#include <iostream>
#include <string>
using namespace std;

class Customer
{
public: 
	//Constructor
	Customer();

	//Mutators
	void setTitle(string titl);
	void setName(string firstNam, string middleNam, string lastNam);
	void setAddress(string add, string cit, string stat);
	void setZip(string zip);
	void setPhone(string phone);

	//Accessors
	string getTitle();
	string getFirstName();
	string getMidName();
	string getLastName();
	string getStreetAdd();
	string getCity();
	string getState();
	string getZip();
	string getPhone();

	//Output
	void displayLabel(ostream &out);
	void displayPhoneListing(ostream &out);

	//Operators
	bool operator ==(Customer& rightOperand) const;

private:
	string title, firstName, middleName, lastName, streetAdd, city, state, zipCode, phoneNum;
};
//Customer imple

#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include "Header1.h"

using namespace std;

Customer::Customer()
{
}

void Customer::setTitle(string titl)
{
	title = titl;
}

void Customer::setName(string firstNam, string middleNam, string lastNam)
{
	firstName = firstNam;
	middleName = middleNam;
	lastName = lastNam;
}

void Customer::setAddress(string add, string cit, string stat)
{
	streetAdd = add;
	city = cit;
	state = stat;
}

void Customer::setZip(string zip)
{
	zipCode = zip;
	if(zipCode.length() > 5)
		zipCode.insert(5, "-");
}

void Customer::setPhone(string phone)
{
	phoneNum = phone;
	phoneNum.insert(0, "(");
	phoneNum.insert(4, ")");
	phoneNum.insert(8, "-");
}

string Customer::getTitle()
{
	return title;
}

string Customer::getFirstName()
{
	return firstName;
}

string Customer::getMidName()
{
	return middleName;
}

string Customer::getLastName()
{
	return lastName;
}

string Customer::getStreetAdd()
{
	return streetAdd;
}

string Customer::getCity()
{
	return city;
}

string Customer::getState()
{
	return state;
}

string Customer::getZip()
{
	return zipCode;
}

string Customer::getPhone()
{
	return phoneNum;
}

void Customer::displayLabel(ostream &out)
{
	out << endl << title << " " << firstName << " " << middleName << " " << lastName << endl;
	out << streetAdd << endl;
	out << city << " " << state << " " << zipCode << endl;
}

bool Customer::operator ==(Customer& rightOperand) const
{
	if(firstName == rightOperand.firstName && middleName == rightOperand.middleName && lastName == rightOperand.lastName)
		return true;
	return false;
}

Where is the *.cpp file that contains main()? Check your project files to make sure one of the *.cpp files contains that function. You said you created an empty project -- my guess is that you forgot to add main()

Oh....wow.

That did the trick..................................I feel like a fool.... :(

This article has been dead for over six months. Start a new discussion instead.