Código:
undefined reference to `suma(int, int)'
undefined reference to `resta(int, int)'
undefined reference to `resta(int, int)'
Acá están los archivos con las instrucciones:
Código
//main.cpp #include "operaciones.h" int main() { int resultadoSU = suma(4,5); int resultadoRE = resta(12,4); printf("El resultado de la suma es: %d \n",resultadoSU); printf("El resultado de la resta es: %d \n",resultadoRE); std::cin.get(); return 0; }
Código
//operaciones.h #ifndef OPERACIONES_H_INCLUDED #define OPERACIONES_H_INCLUDED #include <iostream> #include <stdio.h> int suma(int x , int y); int resta(int x , int y); #endif
Código
//operaciones.cpp #include "operaciones.h" int suma(int x , int y){ return ( x + y ); } int resta(int x , int y){ return ( x - y ); }
Qué estoy haciendo mal?