Hi,
I am getting an error message from MinGW that I just cannot figure what causes.
The error message is:
"Line 16: ISO C++ forbids declaration of 'AreaMap' with no type"
My code is:[CODE=cpp]
#ifndef RANGE_H_INCLUDE D
#define RANGE_H_INCLUDE D
#include "grid.h" //for type: presenceGrid
#include <vector>
#include "AreaMap.h"
class Range
{
private:
struct location {int pos_x; int pos_y;};
int x_size, y_size;
AreaMap& r_map; //LINE 16
std::vector<loc ation> presences;
presenceGrid map;
location start;
void addCell(locatio n);
void grow (int size);
location pickRandomCell( );
location pickCellOnRange ();
location findNeighbourCe ll(location);
bool outsideDomain (location);
public:
Range(AreaMap&) ;
~Range() {}
presenceGrid sample(int size) {grow(size); return map;}
friend class TotalAreaMap;
};
#endif // RANGE_H_INCLUDE D[/CODE]
and the AreaMap class:
[CODE=cpp]
#ifndef MAP_H_INCLUDED
#define MAP_H_INCLUDED
#include <vector>
#include <string>
#include "Species.h"
#include "RangeProp. h"
#include "Envar.h"
/*Holds a map showing land and water of the underlying
domain (continent) where the species are distributed
*/
class AreaMap
{
public:
AreaMap(){}
~AreaMap(){}
void loadSQSfile();
bool land(int y, int x){return (bool) domain[y][x];}
int getXsize(){retu rn x_size;}
int getYsize(){retu rn y_size;}
float getXllCenter(){ return xllcenter;}
float getYllCenter(){ return yllcenter;}
int area();
private:
std::vector<std ::vector<int> > domain;
int x_size;
int y_size;
float xllcenter;
float yllcenter;
friend class Species;
friend class EnVar;
friend class RangeProp;
};
#endif // MAP_H_INCLUDED
[/CODE]
Maybe a fresh (expert) eye can tell the mistake straight away, thanks!
Mike
I am getting an error message from MinGW that I just cannot figure what causes.
The error message is:
"Line 16: ISO C++ forbids declaration of 'AreaMap' with no type"
My code is:[CODE=cpp]
#ifndef RANGE_H_INCLUDE D
#define RANGE_H_INCLUDE D
#include "grid.h" //for type: presenceGrid
#include <vector>
#include "AreaMap.h"
class Range
{
private:
struct location {int pos_x; int pos_y;};
int x_size, y_size;
AreaMap& r_map; //LINE 16
std::vector<loc ation> presences;
presenceGrid map;
location start;
void addCell(locatio n);
void grow (int size);
location pickRandomCell( );
location pickCellOnRange ();
location findNeighbourCe ll(location);
bool outsideDomain (location);
public:
Range(AreaMap&) ;
~Range() {}
presenceGrid sample(int size) {grow(size); return map;}
friend class TotalAreaMap;
};
#endif // RANGE_H_INCLUDE D[/CODE]
and the AreaMap class:
[CODE=cpp]
#ifndef MAP_H_INCLUDED
#define MAP_H_INCLUDED
#include <vector>
#include <string>
#include "Species.h"
#include "RangeProp. h"
#include "Envar.h"
/*Holds a map showing land and water of the underlying
domain (continent) where the species are distributed
*/
class AreaMap
{
public:
AreaMap(){}
~AreaMap(){}
void loadSQSfile();
bool land(int y, int x){return (bool) domain[y][x];}
int getXsize(){retu rn x_size;}
int getYsize(){retu rn y_size;}
float getXllCenter(){ return xllcenter;}
float getYllCenter(){ return yllcenter;}
int area();
private:
std::vector<std ::vector<int> > domain;
int x_size;
int y_size;
float xllcenter;
float yllcenter;
friend class Species;
friend class EnVar;
friend class RangeProp;
};
#endif // MAP_H_INCLUDED
[/CODE]
Maybe a fresh (expert) eye can tell the mistake straight away, thanks!
Mike
Comment