Jump to content
  • Advertisement
Sign in to follow this  
destluck

Any idea what i did wrong?

This topic is 1498 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!