[LC++]curses and vectors

Chris Vine chris at cvine.freeserve.co.uk
Wed Jul 25 08:25:07 UTC 2001


On Tuesday 24 July 2001 05:16, Paul M Foster wrote:
> Curses/ncurses has a macro called "erase" in it. It erases a curses
> window. Vectors (STL) also have a member called "erase", which erases
> objects held in the vector. My problem is that I'm using both in my
> program, and when I compile, I get a variety of errors, all of which are
> a variation on: "...arguments given to macro 'erase'". So the one is
> stepping on the other.
>
> Anyone have any idea how to avoid this problem?
>
> Paul
>

If you are not actually using the curses `erase' function/macro, then you can 
simply #undef erase after you include curses.h.  I had to do this with the 
ncurses `clear' macro, which also causes havoc with C++ streams.

Chris.



More information about the tuxCPProgramming mailing list