Click here to Skip to main content
12,397,480 members (62,228 online)

C / C++ / MFC

 
GeneralRe: fuzzy logic code Pin
robot2920-Dec-12 4:00
memberrobot2920-Dec-12 4:00 
QuestionHow do I select and pasted the mouse MFC loaded image. Pin
cemil.aksoyy15-Dec-12 12:26
membercemil.aksoyy15-Dec-12 12:26 
AnswerRe: How do I select and pasted the mouse MFC loaded image. Pin
Richard MacCutchan15-Dec-12 21:05
mvpRichard MacCutchan15-Dec-12 21:05 
Questionwhat is the purpose of & in constructors Pin
alaaan7315-Dec-12 7:49
memberalaaan7315-Dec-12 7:49 
AnswerRe: what is the purpose of & in constructors Pin
Maximilien15-Dec-12 14:29
memberMaximilien15-Dec-12 14:29 
GeneralRe: what is the purpose of & in constructors Pin
alaaan7318-Dec-12 4:43
memberalaaan7318-Dec-12 4:43 
AnswerRe: what is the purpose of & in constructors Pin
Erudite_Eric16-Dec-12 21:43
memberErudite_Eric16-Dec-12 21:43 
GeneralRe: what is the purpose of & in constructors Pin
alaaan7318-Dec-12 4:43
memberalaaan7318-Dec-12 4:43 
AnswerRe: what is the purpose of & in constructors Pin
CPallini16-Dec-12 22:42
mvpCPallini16-Dec-12 22:42 
GeneralRe: what is the purpose of & in constructors Pin
alaaan7318-Dec-12 4:42
memberalaaan7318-Dec-12 4:42 
AnswerRe: what is the purpose of & in constructors Pin
sajeesh.c17-Dec-12 4:33
membersajeesh.c17-Dec-12 4:33 
GeneralRe: what is the purpose of & in constructors Pin
alaaan7318-Dec-12 4:42
memberalaaan7318-Dec-12 4:42 
AnswerRe: what is the purpose of & in constructors Pin
April Fans22-Dec-12 20:32
memberApril Fans22-Dec-12 20:32 
Questionerror LNK2019: unresolved external symbol "public: SOLVED Pin
alaaan7314-Dec-12 0:24
memberalaaan7314-Dec-12 0:24 
i got this error message in my program :
1>Reservation.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Reservation::ID_sn(void)" (?ID_sn@Reservation@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Reservation::getReservationNumber(void)" (?getReservationNumber@Reservation@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)

and this is the program it contain 2 header files and their cpp file plus the main file

Passenger . h
<pre>#ifndef PASSENGER_H //to avoid redefinition errors
#define PASSENGER_H

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

class Passenger {  //passenger class definition

public:
	 Passenger(); //default constructor
	Passenger(string,string,long);//parameterized constructor  
	//set functions:
	void setPassengerName(string);
	void setPassportNumber(string);
	void setContactNumber(long);
	//get functions:
	string getPassengerName();
	string getPassportNumber();
	long getContactNumber();
 
	void printDetails();
	
private://data members :
	string passengerName;
	string passportNumber;
	long contactNumber;
}; //end class Passenger
#endif

Passenger . cpp
<pre>#include <iostream>
#include "Passenger.h"
using namespace std;
 
Passenger::Passenger(string a="",string b="",long c=0)//Constructor that initializes the data members to given parameters
{
	setPassengerName(a);
	setPassportNumber(b);
	setContactNumber(c);
} //end constuctor Passenger body

 
void Passenger::setPassengerName(string Pname)
{
	passengerName=Pname;
} //end function setPassengerName

void Passenger::setPassportNumber(string Pnum)
{
	passportNumber=Pnum;
} //end function setPassportNumber
void Passenger::setContactNumber(long Cnum)
{
	contactNumber=Cnum;
} //end function setContactNumber

string Passenger::getPassengerName()
{
	return passengerName;
} //end function getPassengerName
string Passenger::getPassportNumber()
{
	return passportNumber;
}//end function getPassportNumber
long Passenger::getContactNumber()
{
	return contactNumber;
} //end function getContactNumber

void Passenger::printDetails()
{
	cout<<"passenger name:            "<<getPassengerName()<<"\npassenger Passport Number: "<<getPassportNumber()<<
	"\npassenger contact number:  "<<getContactNumber()<<"\n\n";
} //end function printDetails

Reservation . h
<pre>#ifndef RESERVATION_H_  //to avoid redefinition errors
#define RESERVATION_H_

#include <iostream>
#include <string>
#include "Passenger.h"
 
using namespace std;
 

class Reservation{
 
private:
	static int sn;//serial number 
    const string ID; //first two letters of passanger name plus sn
	bool smokerSeat;
	Passenger passenger;
		
public:
	
 
	//Constructor taking the parameters of Passenger
	Reservation(string psngrName, long psngrPhone, string psngrPassport, bool 	smoke);
	
	//Constructor taking a Passenger object 
	Reservation(Passenger& psngr, bool smoke); 
	
	Passenger getPassenger();		
	bool isSmoker();// to check if the passenger is smoker or not  
	
	string getReservationNumber();	//getReservation number = getId 
	void printDetails(); // to print passenger details
	string ID_sn();
	
};
 

#endif /*RESERVATION_H_*/



main .cpp
<pre>#include <iostream>
#include "Passenger.h"
#include "reservation.h"
 
int main()
{
	Passenger passenger1("aar","k9",23596); //create an object for Passenger class with argument 
	Passenger *passengerPtr=&passenger1; //pointer that refrnce to the object 
	passengerPtr->printDetails();//calling 
	
	Reservation reservation("aarr",566,"t77",0);
	Reservation *reservationPtr=&reservation;
	reservationPtr->printDetails(); 
	
	system("PAUSE");
 
	
} //end main

Im a beginner in programming and that's problem make me really confused
** i think the problem in the Reservation.cpp
Because when i test the other file's it was working but after i added the implementation for the reservation header this problem was appeared

modified 14-Dec-12 7:41am.

AnswerRe: error LNK2019: unresolved external symbol "public: Pin
Jochen Arndt14-Dec-12 0:38
memberJochen Arndt14-Dec-12 0:38 
GeneralRe: error LNK2019: unresolved external symbol "public: Pin
alaaan7314-Dec-12 0:49
memberalaaan7314-Dec-12 0:49 
AnswerRe: error LNK2019: unresolved external symbol "public: Pin
Graham Breach14-Dec-12 0:40
memberGraham Breach14-Dec-12 0:40 
GeneralRe: error LNK2019: unresolved external symbol "public: Pin
alaaan7314-Dec-12 0:50
memberalaaan7314-Dec-12 0:50 
Questionhow to learn c++ according to my goal Pin
ziuss213-Dec-12 19:28
memberziuss213-Dec-12 19:28 
AnswerRe: how to learn c++ according to my goal Pin
Richard MacCutchan13-Dec-12 22:39
mvpRichard MacCutchan13-Dec-12 22:39 
GeneralRe: how to learn c++ according to my goal Pin
ziuss213-Dec-12 22:45
memberziuss213-Dec-12 22:45 
GeneralRe: how to learn c++ according to my goal Pin
Richard MacCutchan13-Dec-12 23:39
mvpRichard MacCutchan13-Dec-12 23:39 
AnswerRe: how to learn c++ according to my goal Pin
sajeesh.c13-Dec-12 23:24
membersajeesh.c13-Dec-12 23:24 
GeneralRe: how to learn c++ according to my goal Pin
ziuss214-Dec-12 0:02
memberziuss214-Dec-12 0:02 
GeneralRe: how to learn c++ according to my goal Pin
Richard MacCutchan14-Dec-12 2:16
mvpRichard MacCutchan14-Dec-12 2:16 
GeneralRe: how to learn c++ according to my goal Pin
ziuss214-Dec-12 3:23
memberziuss214-Dec-12 3:23 
GeneralRe: how to learn c++ according to my goal Pin
Richard MacCutchan14-Dec-12 3:33
mvpRichard MacCutchan14-Dec-12 3:33 
AnswerRe: how to learn c++ according to my goal Pin
Maximilien15-Dec-12 15:00
memberMaximilien15-Dec-12 15:00 
GeneralRe: how to learn c++ according to my goal Pin
ziuss215-Dec-12 20:10
memberziuss215-Dec-12 20:10 
GeneralRe: how to learn c++ according to my goal Pin
Maximilien16-Dec-12 1:55
memberMaximilien16-Dec-12 1:55 
GeneralRe: how to learn c++ according to my goal Pin
ziuss216-Dec-12 2:02
memberziuss216-Dec-12 2:02 
AnswerRe: how to learn c++ according to my goal Pin
PecuniousPete16-Dec-12 21:00
memberPecuniousPete16-Dec-12 21:00 
SuggestionRe: how to learn c++ according to my goal Pin
April Fans20-Dec-12 19:09
memberApril Fans20-Dec-12 19:09 
QuestionMessage sending in Lan C# win form Pin
123sudheer12313-Dec-12 19:19
member123sudheer12313-Dec-12 19:19 
AnswerRe: Message sending in Lan C# win form Pin
Richard MacCutchan13-Dec-12 22:37
mvpRichard MacCutchan13-Dec-12 22:37 
AnswerRe: Message sending in Lan C# win form Pin
sajeesh.c14-Dec-12 2:31
membersajeesh.c14-Dec-12 2:31 
AnswerRe: Message sending in Lan C# win form Pin
vr99999999915-Dec-12 1:29
membervr99999999915-Dec-12 1:29 
QuestionGraphics Interface (game) Pin
April Fans13-Dec-12 18:37
memberApril Fans13-Dec-12 18:37 
AnswerRe: Graphics Interface (game) Pin
Richard MacCutchan13-Dec-12 22:40
mvpRichard MacCutchan13-Dec-12 22:40 
GeneralRe: Graphics Interface (game) Pin
April Fans20-Dec-12 19:13
memberApril Fans20-Dec-12 19:13 
QuestionCompilation Problem Pin
BobInNJ13-Dec-12 14:15
memberBobInNJ13-Dec-12 14:15 
AnswerRe: Compilation Problem Pin
Graham Breach13-Dec-12 21:58
memberGraham Breach13-Dec-12 21:58 
GeneralRe: Compilation Problem Pin
BobInNJ14-Dec-12 11:16
memberBobInNJ14-Dec-12 11:16 
GeneralRe: Compilation Problem Pin
Graham Breach14-Dec-12 23:31
memberGraham Breach14-Dec-12 23:31 
Questionerror C2678: binary '=' Pin
alaaan7313-Dec-12 6:41
memberalaaan7313-Dec-12 6:41 
SuggestionRe: error C2678: binary '=' Pin
Maximilien13-Dec-12 7:00
memberMaximilien13-Dec-12 7:00 
GeneralRe: error C2678: binary '=' Pin
alaaan7313-Dec-12 7:18
memberalaaan7313-Dec-12 7:18 
AnswerRe: error C2678: binary '=' Pin
Chris Meech13-Dec-12 7:30
memberChris Meech13-Dec-12 7:30 
GeneralRe: error C2678: binary '=' Pin
alaaan7313-Dec-12 7:52
memberalaaan7313-Dec-12 7:52 
GeneralRe: error C2678: binary '=' Pin
Chris Meech13-Dec-12 8:17
memberChris Meech13-Dec-12 8:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 25 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid