I’ve looked a lot, tried a bunch of things I found on stackoverflow and other websites but I still can’t figure out how to fix this…
Main C++ file : source.cpp
#include "sources.h"
#include "fft_windows.h"
...
source.h
#include "Array2D.h"
...
Array2D.h
#ifndef ARRAY2D_H_
#define ARRAY2D_H_
#include <cassert>
#include "Features.h"
template <class T> class Array2D{
...
};
#endif
Features.h
#ifndef FEATURES_H_
#define FEATURES_H_
#include <string>
using namespace std ;
class Features : public Array2D {
...
};
#endif
fft_window.h (function declarations that are defined in fft_window.cpp)
//#include "Array2D.h"
template <class T>class Array2D;
void random_example(unsigned int i, Array2D <double> &arr);
...
I’ve tried everything I found and for some reason I still get this error in Features.h on the class Features : public Array2D { line…
Any idea ?
First,
Features.hneeds to includeArray2D.h, second you get an infinite include recursion with that, and third you need to specify the template parameter when inheriting fromArray2D: