libstdc++-v3 build failure

Robert Lipe robertl@sco.com
Tue Apr 17 08:24:00 GMT 2001


Since someone finally fixed the -fPIC thing, my build now proceeds long
enough for libstdc++ to start failing to build once again. ;-)

/play/tmp/7/gcc/g++ -B/play/tmp/7/gcc/ -nostdinc++ -L/play/tmp/7/i686-pc-udk/lib
stdc++-v3/src -L/play/tmp/7/i686-pc-udk/libstdc++-v3/src/.libs -B/usr/local/i686
-pc-udk/bin/ -B/usr/local/i686-pc-udk/lib/ -isystem /usr/local/i686-pc-udk/inclu
de -nostdinc++ -I/play/egcs/libstdc++-v3/include -I/play/egcs/libstdc++-v3/inclu
de/std -I/play/egcs/libstdc++-v3/include/c_std -I../include -I/play/egcs/libstdc
++-v3/libsupc++ -I../libio -I/play/egcs/libstdc++-v3/libio -I/play/egcs/libstdc+
+-v3/libmath -fno-implicit-templates -Wall -Wno-format -W -Wwrite-strings -Winli
ne -g -c basic_file.cc
In file included from ../include/bits/basic_file_model.h:34,
                 from /play/egcs/libstdc++-v3/include/bits/basic_file.h:246,
                 from basic_file.cc:34:
/play/egcs/libstdc++-v3/include/c_std/bits/std_cstdlib.h:115: previous
   declaration of `void std::exit(int)' with C linkage
/udk/usr/include/unistd.h:271: conflicts with new declaration with C++ linkage
/udk/usr/include/unistd.h:271: `exit' is already declared in this scope
make[2]: *** [basic_file.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive-am] Error 2


When I look in <unistd.h>, I find this horror of a construct:

extern int      acct(const char *);
#if defined(__cplusplus) && !defined(_CFRONT_3_0)
namespace std { extern "C++" void exit(int); } using std::exit;
#else
extern void     exit(int);
#endif

Since g++ IS __cplusplus but isn't cfront (sigh) we pick up the former
definition.   Is this appropriate for G++?   Should we fixinclude this
bit of silliness away?    If so, which should we whack?

RJL



More information about the Gcc-bugs mailing list