Error- Undefined reference to
Publicado por Steven (1 intervención) el 27/09/2018 03:22:36
Hola, tengo el error "Undefined reference to", aquí están las lineas de código
Main.cpp
Cita.cpp
Cita.h
Y el error exacto es:
C:\Users\USUARIO\Desktop\SALUD\Saludcop\Cita.o Cita.cpp:(.text+0x193): undefined reference to `Cita::Ult_Cita()'
Gracias
Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include "Cita.h"
using namespace std;
int main()
{
int opcion;
Cita cita;
do{
cout <<"***********************************************"<<endl;
cout <<"**************** SaludCop ****************"<<endl;
cout <<"(1) Citas."<<endl;
cout <<"(2) Pacientes "<<endl;
cout <<"(3) InGreso de pacientes."<<endl;
cout <<"(4) Condición del paciente."<<endl;
cout <<"(5) Salir"<<endl;
cout <<endl<<"Ingrese una Opcion ="<<endl;
cin >>opcion;
cout <<"***********************************************"<<endl;
if(opcion==1)
cita.LeerCita();
}while(opcion!=5);
//system("pause");
return 0;
}
Cita.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<iostream>
#include"Cita.h"
using namespace std;
Cita::Cita()
{
}
Cita::~Cita()
{
}
void Cita::LeerCita()
{
int x=0; // Cantidad iteracciones
cout <<"++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout <<"+++++++++++++++ Citas ++++++++++++++++++"<<endl;
cout <<"++++++++++++++++++++++++++++++++++++++++++++++"<<endl<<endl;
cout <<"Seleccione una opcion "<<endl;
cout <<"(1) Ultima Cita."<<endl;
cin >>x;
if(x==1)Ult_Cita();
}
Cita.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef CITA
#define CITA
class Cita
{
private:
public:
Cita();
~Cita();
void LeerCita();
void Ult_Cita();
};
#endif
Y el error exacto es:
C:\Users\USUARIO\Desktop\SALUD\Saludcop\Cita.o Cita.cpp:(.text+0x193): undefined reference to `Cita::Ult_Cita()'
Gracias
Valora esta pregunta


0