hello everyone,
Im a student having to write a C++ program and im running into an error that I have been unable to find the solution on my own. Im running into an error as I test run the program to make sure everything is still ok. The program isnt finished however at the moment it should still compile fine.

When I run this program I get the following errors:
BTW I am using VS 2005 on windows 7

Error	4	error LNK2005: "public: __thiscall UTAevent::UTAevent(void)" (??0UTAevent@@QAE@XZ) already defined in UTAevent.obj	UTA.obj	
Error	5	error LNK2005: "public: void __thiscall UTAevent::display(void)const " (?display@UTAevent@@QBEXXZ) already defined in UTAevent.obj	UTA.obj	
Error	6	error LNK2005: "public: bool __thiscall UTAevent::set_totalCost(float)" (?set_totalCost@UTAevent@@QAE_NM@Z) already defined in UTAevent.obj	UTA.obj	
Error	7	error LNK2005: "public: bool __thiscall UTAevent::set_number(int)" (?set_number@UTAevent@@QAE_NH@Z) already defined in UTAevent.obj	UTA.obj	
Error	8	error LNK2005: "public: char __thiscall UTAevent::set_name(char *)" (?set_name@UTAevent@@QAEDPAD@Z) already defined in UTAevent.obj	UTA.obj	
Error	9	error LNK2005: "public: bool __thiscall UTAevent::set_type(char)" (?set_type@UTAevent@@QAE_ND@Z) already defined in UTAevent.obj	UTA.obj	
Error	10	error LNK2005: "public: bool __thiscall UTAevent::set_purpose(char)" (?set_purpose@UTAevent@@QAE_ND@Z) already defined in UTAevent.obj	UTA.obj	
Error	11	error LNK2005: "public: bool __thiscall UTAevent::set_time(float)" (?set_time@UTAevent@@QAE_NM@Z) already defined in UTAevent.obj	UTA.obj	
Error	12	error LNK2005: "public: bool __thiscall UTAevent::set_day(int)" (?set_day@UTAevent@@QAE_NH@Z) already defined in UTAevent.obj	UTA.obj	
Error	13	error LNK2005: "public: bool __thiscall UTAevent::set_month(int)" (?set_month@UTAevent@@QAE_NH@Z) already defined in UTAevent.obj	UTA.obj	
Error	14	error LNK2005: "public: bool __thiscall UTAevent::set_size(int)" (?set_size@UTAevent@@QAE_NH@Z) already defined in UTAevent.obj	UTA.obj	
Error	15	error LNK2005: "public: bool __thiscall UTAevent::set_cost(float)" (?set_cost@UTAevent@@QAE_NM@Z) already defined in UTAevent.obj	UTA.obj	
Error	16	error LNK2005: "public: char __thiscall UTAevent::set_building(char *)" (?set_building@UTAevent@@QAEDPAD@Z) already defined in UTAevent.obj	UTA.obj	
Error	17	error LNK2005: "public: char __thiscall UTAevent::set_room(char *)" (?set_room@UTAevent@@QAEDPAD@Z) already defined in UTAevent.obj	UTA.obj	
Error	18	error LNK2005: "public: bool __thiscall UTAevent::set_length(int)" (?set_length@UTAevent@@QAE_NH@Z) already defined in UTAevent.obj	UTA.obj	
Error	19	error LNK2005: "public: bool __thiscall UTAevent::set_predict(int)" (?set_predict@UTAevent@@QAE_NH@Z) already defined in UTAevent.obj	UTA.obj	
Error	20	error LNK2005: "public: __thiscall UTAevent::~UTAevent(void)" (??1UTAevent@@QAE@XZ) already defined in UTAevent.obj	UTA.obj	
Error	21	fatal error LNK1169: one or more multiply defined symbols found	C:\Users\Tyler\Documents\Visual Studio 2005\Projects\Lab 4\Debug\Lab 4.exe

this is my UTAevent.h file

using namespace std;

class UTAevent
{
public:
	UTAevent();
	//PRECONDITION: none
	//
	//POSTCONDITION: The data members of the object have
	//				 been initialized to default values.
	~UTAevent();
	//PRECONDITION: none
	//
	//POSTCONDITION: the employee is properly destroyed.
	//
	bool set_number(int num);
	//PRECONDITION: num must be a positive num that is associated with a
	//				specific event.
	//POSTCONDITION: number has been set to num.
	//
	char set_name(char *nam);
	//PRECONDITION: none
	//
	//POSTCONDITION: the name associated with a specific event has been set.
	//
	bool set_type(char typ);
	//PRECONDITION: typ must be of one of the specified event types.
	//
	//POSTCONDITION: the character code of the event type has been set.
	//
	bool set_purpose(char purp);
	//PRECONDITION: none
	//
	//POSTCONDITION: if the return value is true, purp has been added. if
	//				the return value is false, purp was not added.
	bool set_time(float tim);
	//PRECONDITION: none
	//
	//POSTCONDITION: if the return value is true, tim has been added. if
	//				the return value is false, tim was not added.
	bool set_day(int days);
	//PRECONDITION: none
	//
	//POSTCONDITION: if the return value is true, days has been added. if
	//				the return value is false, days was not added.
	bool set_month(int mon);
	//PRECONDITION: none
	//
	//POSTCONDITION: if the return value is true, mon has been added. if
	//				the return value is false, mon was not added.
	bool set_size(int siz);
	//PRECONDITION: none
	//
	//POSTCONDITION: if the return value is true, siz has been added. if
	//				the return value is false, siz was not added.
	bool set_cost(float cos);
	//PRECONDITION: none
	//
	//POSTCONDITION: if the return value is true, cos has been added. if
	//				the return value is false, cos was not added.
	char set_building(char *bui);
	//PRECONDITION: none
	//
	//POSTCONDITION: if the return value is true, *bui has been added. if
	//				the return value is false, *bui was not added.
	char set_room(char *roo);
	//PRECONDITION: none
	//
	//POSTCONDITION: if the return value is true, roo has been added. if
	//				the return value is false, roo was not added.
	bool set_length(int len);
	//PRECONDITION: none
	//
	//POSTCONDITION: if the return value is true, len has been added. if
	//				the return value is false, len was not added.
	bool set_predict(int pre);
	//PRECONDITION: none
	//
	//POSTCONDITION: if the return value is true, pre has been added. if
	//				the return value is false, pre was not added.
	bool set_totalCost(float tot);
	//PRECONDITION: none
	//
	//POSTCONDITION: if the return value is true, tot has been added. if
	//				the return value is false, tot was not added.
	int get_number() const { return number; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the event number is returned
	//
	const char * get_name() const { return name; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the event name is returned
	//
	char get_type() const { return type; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the event type is returned
	//
	char get_purpose() const { return purpose; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the event purpose is returned
	//
	float get_time() const { return time; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the event time is returned
	//
	int get_day() const { return month; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the day of the event is returned
	//
	int get_month() const { return month; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the event month is returned
	//
	int get_size() const { return size; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the event size is returned
	//
	float get_cost() const { return cost; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the cost of the event is returned
	//
	const char * get_building() const { return building; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the building is returned
	//
	const char * get_room()const { return room; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the room number is returned
	//
	int get_length() const { return length; }
	//PRECONDITION: none
	//
	//POSTCONDITION: the length is returned
	//
	int get_predict() const { return predict;}
	//PRECONDITION: none
	//
	//POSTCONDITION: the attendance prediction is returned
	//
	float get_totalCost() const { return totalCost;}
	//PRECONDITION: none
	//
	//POSTCONDITION: the total cost is returned
	//
	void display() const;
	//PRECONDITION: none
	//
	//POSTCONDITION: the id and number in inventory
	//				have been displayed on standard output
private:
	int number, size, length, predict;
	char *name;
	unsigned month : 4;
	unsigned day : 5; 
	char *room;
	char type, purpose; 
	char *building;
	float cost, time, totalCost;
	enum goal {networking, recruiting, Cfund, Gfund, talent, service}goal;
	union target 
	{	
		int service, recruiting, networking;
		float funds;
		char grade;
	}target;
};

This is UTAevent.cpp file

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h> 
#include <ctype.h>
#include "UTAevent.h"

UTAevent::UTAevent()
{
	number = 0;
	name = new char[1];
	name[0]= '0';
	type = ' ';
	purpose = ' ';
	time = 00.00;
	day = 0;
	month = 0;
	size = 0;
	cost = 0.00;
	building = new char[1];
	building[0] = '0';
	room = new char[1];
	room[0] = '0';
	length = 0;
	totalCost = 0.0;
}
void UTAevent::display() const{
	std::cout << "EVENT\n";
}
bool UTAevent::set_totalCost(float tot){
	if (tot >= 0){
		float addcost = tot;
		totalCost = totalCost + tot;
		return true;
	}
	else
		return false;
}
bool UTAevent::set_number(int num){
	int answer = num;
	if (answer == 842 || answer == 110 || answer == 120 || answer == 130 || answer == 140 || answer == 500 || answer == 803 || answer == 810 || answer == 874 || answer == 990 || answer == 318 || answer == 337 || answer == 301 || answer == 554 || answer == 868 || answer == 935 || answer == 4 || answer == 8 || answer == 10){
		number = num;
		return true;
	}
	else
		return false;
}
char UTAevent::set_name(char *nam){
	name = new char[ strlen(nam)+1];
	strcpy(name , nam);
	return true;
}
bool UTAevent::set_type(char typ){
	char charanswer = typ;
	if (charanswer == 'c' || charanswer == 'C'){
		type = 'C';
		return true;
	}
	else if (charanswer == 'S'|| charanswer == 's'){
		type = 'S';
		return true;
	}
	else if (charanswer == 'P'|| charanswer == 'p'){
		type = 'P';
		return true;
	}
	else if (charanswer == 'N'|| charanswer == 'n'){
		type = 'N';
		return true;
	}
	else if (charanswer == 'D'|| charanswer == 'd'){
		type = 'D';
		return true;
	}
	else if (charanswer == 'l'|| charanswer == 'L'){
		type = 'L';
		return true;
	}
	else if (charanswer == 'b'|| charanswer == 'B'){
		type = 'B';
		return true;
	}
	else if (charanswer == 'o'|| charanswer == 'O'){
		type = 'O';
		return true;
	}
	else
		return false;
}
bool UTAevent::set_purpose(char purp){
	char charanswer = purp;
	if (charanswer == 'F' || charanswer == 'f'){
		purpose = 'F';
		return true;
	}
	else if (charanswer == 'm'|| charanswer == 'M'){
		purpose ='M';
		return true;
	}
	else if (charanswer == 'C'|| charanswer == 'c'){
		purpose ='C';
		return true;
	}
	else if (charanswer == 'S'|| charanswer == 's'){
		purpose ='S';
		return true;
	}
	else if (charanswer == 'v'|| charanswer == 'V'){
		purpose ='V';
		return true;
	}
	else if (charanswer == 'l'|| charanswer == 'L'){
		purpose ='L';
		return true;
	}
	else if (charanswer == 'E'|| charanswer == 'e'){
		purpose ='E';
		return true;
	}
	else if (charanswer == 'A'|| charanswer == 'a'){
		purpose ='A';
		return true;
	}
	else if (charanswer == 'O'|| charanswer == 'o'){
		purpose ='O';
		return true;
	}
	else if (charanswer == 'P'|| charanswer == 'p'){
		purpose ='P';
		return true;
	}
	else
		return false;
}
bool UTAevent::set_time(float tim){
	int hrpart = (int)tim;
	int minpart = ((int)(tim*100)%100);
	if ((hrpart <= 24 || hrpart >=0) && (minpart <=60 || minpart >=0)){
		if (hrpart ==24&& minpart==0){
			return  true;
			time = tim;
		}
		else if(hrpart<24)
		{
			return true;
			time = tim;
		}
		else{
			return false;
		}
	}
	else{
		return false;
	}
}
bool UTAevent::set_day(int days){
	if (days < 0 && days >= 31){
		day = days;
		return true;
	}
	return false;
}
bool UTAevent::set_month(int mon){
	if (mon > 0 && mon <= 12){
		month = mon;
		return true;
	}
	return false;
}
bool UTAevent::set_size(int siz){
	if (siz >= 0 ){
		size = siz;
		return true;
	}
	return false;
}
bool UTAevent::set_cost(float cos){
	if (cos >=0 ){
		cost = cos;
		return true;
	}
	return false;
}
char UTAevent::set_building(char *bui){
	building = new char[ strlen(bui) + 1];
	strcpy(building, bui);
	return true;
}
char UTAevent::set_room(char *roo){
	room = new char[ strlen(roo) + 1];
	strcpy(room, roo);
	return true;
}
bool UTAevent::set_length(int len){
	if (len >= 0 && len <=60){
		length = len;
		return true;
	}
	return false;
}
bool UTAevent::set_predict(int pre){
	return true;
}
UTAevent::~UTAevent(void)
{
	delete [] name;
}

and my main file is

#include "UTAevent.cpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h> 
#include <ctype.h>


using namespace std;

#define TRUE 1
#define FALSE 0
#define EVENTMAX 10
#define EVENTMIN 1

int main()
{
	std::cout<<
		"\n++++++++++ Event Registry ++++++++++\n\n"
		"This program is built to help the user with\n"
		"sort, searching, and printing school events\n"
		"that are going on around their school, home, or\n"
		"business. Due to limited memory, you are only\n"
		"allowed to have a maximum of 10 events. This\n"
		"will fix this in the next update.\n\n";

	UTAevent Event[EVENTMAX];

	std::cout<< 
		"\n++++++++++++ Main Menu ++++++++++++\n\n"
		"1:\t\tSort\n"
		"2:\t\tSearch\n"
		"3:\t\tPrint the data in the array\n"
		"4:\t\tEnd the program\n"
		"\n\nPlease Choose the number associated with your option.\n";
}

Add header guards...

#ifndef HEADER_FILE_H
#define HEADER_FILE_H

/* ... your header statements here ... */

#endif //HEADER_FILE_H

[EDIT]

Take out the #include "UTevent.cpp" in main

That too... I thought he #included "UTAevent.h"...

Edited 6 Years Ago by Fbody: n/a

can any one send me C++ code for 2-3-4 tree insertion, deletion and search code plz...email snipped

Edited 6 Years Ago by WaltP: email snipped

Comments
Oh just go away with your whiny "plzsendemailanswer" posts.
Yeah, that's NOT happenin'
This article has been dead for over six months. Start a new discussion instead.