error LNK2019: unresolved external symbol, What to do?

Ok I was doing this program with an array of objects and this error bumps out 5 time but with different functions of the class being called wrong...

I think...

Error 1 error LNK2019: unresolved external symbol "public: void __thiscall Empleado::setCategoría(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?setCategoría@Empleado@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "void __cdecl iniciaLista(class Empleado (* const)[2])" (?iniciaLista@@YAXQAY01VEmpleado@@@Z) JosephAsigMay.obj


I know its pretty messy looking at it but, its the only thing bothering me and my program to run properly...


I din't post the whole source here cuz I don't want anyone to make my program, I want to understand this error and how to resolve it without messing something else inside the structure of the code. If you need to see the code just say so and I will post it...

Thanks

Anyone?

Last edited on
You probably have defined the prototype of the function Empleado::setCategoría() in the class, but you haven't defined it in the .cpp file.
Or you declared but not implemented Empleado::setCategoría or you are not linking the file in which was implemented

By the way I don't think 'í' is good for symbol names
If we assume no language extensions, valid identifiers follow this pattern: ("_"|[A-Za-z])("_"|[A-Za-z]|[0-9])*
Last edited on
Thanks, but I have declare and defined every funtion on the class.
They are implemented on the .cpp of the main functions.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Para crear la lista y asignarle valores.
void iniciaLista(Empleado lista[][2])
{

	// El arreglo de los empleados. 
	string empleados[CANT][2] = {{"Lilliam", "Gerente"}, {"Pepito", "Ejecutivo"},{"Ulises", "Gerente"}, {"Natalia", "Asociado"}, {"Janet", "Ejecutivo"}, {"Urano", "Asociado"}, {"Hector", "Gerente"}, {"Ayani", "Asociado"}, {"Yazuki", "Ejecutivo"}, {"Swazeni", "Asociado"} };

	// La cantidad de sueldo para cada empleado. 
	double sueldos[CANT] = {{15000}, {40000}, {20500}, {10200}, {50000}, {11500}, {15500}, {10200}, {75000}, {10200}};

	for(int i = 0; i < CANT; i++)
	{
		for(int j = 0; j < 2; j++)
		{
			lista[i][j].setNombre(empleados[i][j]);
			lista[i][j].setSueldoAnual(sueldos[i]);
			lista[i][j].setCategoría(empleados[i][j]);
		}
	}
}


See they are being called by the object of the class Empleado.

To set the names of each Employee inside the array to the Object via the function, the same with the Salary Function and the Category function.

See, so what would be the problem? Are those function calling the right parameters?

Anyone..?
Thanks,
PSPMAN90

Last edited on
Show us the declaration and the body of setCategoría
Topic archived. No new replies allowed.