From: Anand Hariharan on
On Oct 8, 12:12 am, Ian Collins <ian-n...(a)> wrote:
> ArbolOne wrote:
> > Hello folks
> > I have a class that permeates in all and every class, it is a
> > MyException class kind of thing. The problem is that I have defined a
> > LINE variable like so"
> > #define  LINE      __LINE__
> That's not a variable.
> Why can't you just use __LINE__, which is a reserved token which can't
> be usurped in application code?

To the OP - Ian's right.

My question is what the preprocessor does here. Am fairly certain
that LINE is not a substitution for __LINE__ but rather the line
number in the header file where that directive was encountered -- is
that correct?

> > Now that I am trying to recompile my program in WindowsXP and using
> > the latest MS-Release of gtkmm, I get a message saying that I
> > stock.h's
> > extern GTKMM_API const Gtk::BuiltinStockID FILE;             /*!<
> > @image html gtk-file.png                */
> > expects more parameters.
> > Obviously the compiler thinks that I am reffering to the LINE defined
> > in stock.h and not the one defined in MyException.hpp.
> > Can someone give me an idea how to resolve this problem without having
> > to change my library.
> Change your library!

OP - Is your question about __LINE__ or __FILE__? If there can be
such a thing as "MORE WRONG", then substituting FILE for __FILE__ is
much worse than LINE for __LINE__ (which as Ian pointed out is wrong).

- Anand