[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compilation problem under SuSE Linux



> 
> "Hammerton J." <james@let.rug.nl> writes:
> >   /users1/james/interviews/include/IV-2_6/InterViews/minmax.h: In function `int min(int, int)':

[snip]

> >   /users1/james/interviews/include/IV-2_6/InterViews/minmax.h:34: redefinition of `int min(int, int)'
> >   /usr/include/g++/minmax.h:35: `int min(int, int)' previously defined here
> 
> I have no /usr/include/*/minmax.h on my linux systems (RH 6.2 or 7.2)
> -- seems to be a "feature" of SUSE or something.  This is the source
> of the problem -- you might need to find a #define to prevent
> including minmax.h or somehow make the definitions of these functions
> under Interviews match that on your system..

I managed to fix the problem by modifying the
"interviews/include/IV-2_6/Interviews/minmax.h" file as in the following 
excerpt:

  #ifndef iv2_6_minmax_h #define iv2_6_minmax_h

  #include <InterViews/boolean.h>

  #define declare_2(T) \
  inline T min(T a, T b) { return a < b ? a : b; } \
  inline T max(T a, T b) { return a > b ? a : b; } \

  #ifndef _minmax_h // G++ under SuSE Linux 7.2 defines these already. 
  declare_2(int)
  declare_2(unsigned)
  declare_2(float)
  declare_2(double)
  #endif

Then, aside from not being able to find the termcap library which I
fixed by providing a symbolic link to the ncurses library, everything
went smoothly.
 

James