First I'll show you my class:
header:
- Code: Select all
#ifndef LABERINT_HPP
#define LABERINT_HPP
#include <cmath>
#include "Arbol.hpp"
using namespace std;
class Laberint {
private:
typedef struct {
int id;
int dist_esq;
int dist_dret;
int porta_esq;
int porta_dret;
}sala;
Arbol<sala> a;
typedef struct {
double t;
int mcr_final;
}t_i_mcrfinal;
typedef struct {
bool d;
bool vel;
bool atrapat;
}direc_vel;
public:
Laberint();
~Laberint();
direc_vel calcular_dir_i_vel(sala s,int mcr,int mcr_actual,int v);
t_i_mcrfinal millor_temps(double t_e,double t_d,int mcr_e,int mcr_d);
};
#endif
cpp:
- Code: Select all
direc_vel Laberint::calcular_dir_i_vel(sala s,int mcr,int mcr_actual,int v)
{
direc_vel x;
some code here
return x;
}
t_i_mcrfinal Laberint::millor_temps(double t_e,double t_d,int mcr_e,int mcr_d)
{
t_i_mcrfinal x;
x.t = t_e;
x.mcr_final = mcr_e;
return x;
}
The errors I get are:
- Code: Select all
Laberint.cpp:6: error: ‘direc_vel’ does not name a type
Laberint.cpp:82: error: ‘t_i_mcrfinal’ does not name a type





