• Advertisement
Sign in to follow this  

Any idea what i did wrong?

This topic is 1323 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Alright i keep getting 2 errors:

 

Error    1    error LNK2005: _main already defined in main.obj
 

Error    2    error LNK1169: one or more multiply defined symbols found

#include<iostream>
#include <string>
#include <random>
#include <time.h>


using namespace std;

class Player
{
	public:	
		
		string mFirstName;
		string mLastName;
		string mStreetName;
		string mGender;

		int mAdress;
		int mAge;

	};


Player GetPlayerFromConsole()
{
	
	Player npc;

	cout << " New Player Signup: " << endl;


	cout << "Enter your first name: " << endl;
	cin >> npc.mFirstName;
	
	cout << "Enter your last name: " << endl;
	cin >> npc.mLastName;

	cout << " Enter your Age: " << endl;
	cin >> npc.mAge;

	cout << "Enter your Gender: " << endl;
	cin >> npc.mGender;

	cout << "Enter your Street name: " << endl;
	cin >> npc.mStreetName;

	cout << "Enter your adress: " << endl;
	cin >> npc.mAdress;

	return npc;
}

int main()
{

	Player newPlayer;

	newPlayer = GetPlayerFromConsole();

	cout << "New Player info Sheet: " << endl;
	cout << "Player name: " << newPlayer.mFirstName << endl;
	cout << newPlayer.mFirstName << endl;
	cout << "Player Adress: " << newPlayer.mAdress << newPlayer.mStreetName << endl;
	cout << "Player Gender: " << newPlayer.mGender << endl;

	cin.get();
        system("pause");
	return 0;
	

	}
Edited by destluck

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement