It seems curses already defines LINES and COLS as non-constant ints. The following code works when USE_CURSES is not defined, (thus using the constsants for COLS and LINES). If USE_CURSES is defined (hence including curses.h) and using the non-const int definition of COLS and LINES, it is illegal. I know nothing about curses, however. Are you trying to make map a 2d array of a size that varies at compile time? If so, you need to use dynamic memory.
Code:
// #define USE_CURSES
#ifdef USE_CURSES
#include <curses.h>
#else
const int COLS=5;
const int LINES=5;
#endif
class SMap {
public:
~SMap(void);
void blend(SMap &);
char map[COLS][LINES];
};
void SMap::blend(SMap &smap) {
for (int a = 0; a < COLS; a++)
for (int b = 0; b < LINES; b++)
if (smap.map[a][b] != map[a][b])
smap.map[a][b] = map[a][b];
}
int main() {
return 0;
}