I m quite new to c++ but working hard. I m using the boost::multi_array library in a project but I got problem with typedef.
//in main.h
#include "boost/multi_array.hpp"
#DEFINE D
#include "montecarlo.h"
typedef boost::multi_array<double, D> array_type;
typedef boost::multi_array<int, D> array_type_int;
then I use array_type and array_type int in another header:
//in montecarlo.h
#ifndef MONTECARLO_INCLUDED
#include "main.h"
namespace mc
{
double foo(const array_type_int&,array_type&);
}
#endif
and it's cpp file:
// in montecarlo.cpp
#include"main.h"
void mc::foo(const array_type_int& ARRAYA,array_type& ARRAYB){
ARRAYA[0]=ARRAYB[0]
}
then I get this errors I cannot understand since my typedef is common to both 2 files
montecarlo.h:5:33: error: ‘array_type_int’ does not name a type
double distanceEvaluation(const array_type_int&, const array_type&,const int);
^~~~~~~~~~~~~~
montecarlo.h:5:56: error: ‘array_type’ does not name a type
double foo(const array_type_int&, const array_type&,const int);
thank you for your help!