Subject: error: a working C++ compiler is required
To: None <current-users@netbsd.org>
From: David Hopper <dhop@nwlink.com>
List: current-users
Date: 12/12/2002 13:00:58
I've not been able to build a working source tree since the end of October 
on Alpha.

The command I use is './build.sh -D /build/tree -R /build/tars', or
'./build.sh -t'.  There are no stale obj dirs in the source tree:  I've 
deleted the entire tree and downloaded -current tars on a number of 
occasions, all with the same result.  Packages I've been updating all seem 
to build correctly, however.  My userland dates to October 25, and kernel 
is Nov. 30.

I thought that build.sh was essentially a fishbowl, and didn't require any 
updates or changes outside the source tree itself.  I'm finding that's not 
really true in practice.

The error I get during the tools build is:

configure:788: checking whether the C++ compiler (c++ -O ) works
configure:804: c++ -o conftest -O   conftest.C  1>&5
/usr/lib/libstdc++.so: warning: reference to compatibility vfork(); include 
<unistd.h> for correct reference
configure:830: checking whether the C++ compiler (c++ -O ) is a cross-compiler
configure:835: checking whether we are using GNU C++
configure:844: c++ -E conftest.C
configure:863: checking whether c++ accepts -g
configure:905: checking that C++ compiler can compile simple program
configure:918: c++ -o conftest -O   conftest.C  1>&5
/usr/lib/libstdc++.so: warning: reference to compatibility vfork(); include 
<unistd.h> for correct reference
configure:932: checking that C++ static constructors and destructors are called
configure:957: c++ -o conftest -O   conftest.C  1>&5
/usr/lib/libstdc++.so: warning: reference to compatibility vfork(); include 
<unistd.h> for correct reference
configure: failed program was:
#line 938 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif

extern "C" {
   void _exit(int);
}
int i;
struct A {
   char dummy;
   A() { i = 1; }
   ~A() { if (i == 1) _exit(0); }
};
A a;
int main() { return 1; }

Thanks,
Dave