Subject: Build error in gnu sources
To: None <current-users@NetBSD.ORG>
From: Trevin Beattie <trevin@xmission.com>
List: current-users
Date: 03/27/1996 18:53:38
I've tried both with the March 16 sources and now the March 23 sources, and
both have the exact same error in src/gnu/lib/libg++:

g++ -O -I/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src
-I/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libio
-nostdinc++
-I/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../include
-I/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libio
-I/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++
-c AllocRing.cc
In file included from
/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/new
.h:6, from AllocRing.cc:24:
/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/std
/new.h:25: declaration of `__nw' as array of functions
/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/std
/new.h:25: `__nw' redeclared as different kind of symbol
/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/std
/new.h:24: previous declaration of `void * operator new (unsigned int)'
/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/std
/new.h:27: declaration of `__dl' as array of functions
/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/std
/new.h:27: `__dl' redeclared as different kind of symbol
/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/std
/new.h:26: previous declaration of `void  operator delete (void *)'
/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/std
/new.h:31: syntax error before `{'
*** Error code 1

Stop.


Aside from trying to find a fix, I'd like to know why operator new and
operator delete are being redefined in new.h?  The code causing the error is:

// replaceable signatures
void *operator new (size_t);
void *operator new[] (size_t);
void operator delete (void *);
void operator delete[] (void *);


I thought that these definitions were pre-defined in C++ as well as illegal
in C...  Wait a minute; these are EXACTLY the error messages gcc would spit
out!  So why does g++ have this problem?  And why write `extern "C"` all
over if this is a C++ header?
-----------------------
Trevin Beattie          "Do not meddle in the affairs of wizards,
trevin@xmission.com     for you are crunchy and good with ketchup."
      {:->                                     --unknown