On 13-May-2002 Michael WARDLE wrote: > Hi > > I'm currently building Blackbox on an SGI Origin, and it seems to get > most of the way there using the suggestions on http://freeware.sgi.com > which basically say to use GCC/G++ and to disable using the versions > of libgen, libnsl, and libsocket that configure finds, since they're > all available in stdio/stdlib. > > I'm building with -LANG:std as Blackbox won't build without it (and > this does seem to be the correct thing to do). > > The build process gets most of the way thru, but fails when building > Window.cc with an error: > The namespace "std" has no member "abs" >
We left out the #include <cstdlib>. One of the joys of STL coding is that some headers get included on some systems and not on others. This is simply sloppy coding on our part. > The first thing that seems to be wrong is I can't find anywhere a >#include that brings something in that provides abs(). On my IRIX > system, it seems to be defined in /usr/include/stdlib.h. > > If this is the problem, then could stdlib please be #included in > Window.cc or a header file included by it? I also can't see > namespaces being used explicitly anywhere else, so maybe std::abs() > should just be abs() to be consistent with the rest of the code. > Actually we use std:: as much as possible unless it gets in the way of readability.
