re: [vserver] www.cplusplussucks.com

About this list Date view Thread view Subject view Author view Attachment view

From: Jacques Gelinas (jack_at_solucorp.qc.ca)
Date: Thu Apr 25 2002 - 13:17:08 EDT


On Wed, 24 Apr 2002 18:41:25 -0500, Sam Vilain wrote
> I'm getting this wierd compile error on one of my test machines:

Which gcc distribution is this. There are problems in the STL headers on
some GCC version. I just compiled it on a pretty vanilla rh6.2. The STL
headers are part of the package egcs-c++-1.1.2-30

> linux10321:~/vserver/dist/vserver-0.17$ make
> gcc -funsigned-char -Wall -g -DVERSION=\"0.17\" chcontext.cc syscall.o -o chcontext
> \
> -lstdc++
> In file included from /usr/include/sys/wait.h:39,
> from vutil.h:7,
> from chcontext.cc:17:
> /usr/include/bits/waitflags.h:26: warning: `WNOHANG' redefined
> /usr/include/linux/wait.h:4: warning: this is the location of the previous definition
> /usr/include/bits/waitflags.h:27: warning: `WUNTRACED' redefined
> /usr/include/linux/wait.h:5: warning: this is the location of the previous definition

To compile the utility, I am including <linux/capability.h> and this is kind
of bad. The kernel headers are not meant to be included. Normally, glibc
include files are providing the necessary services to shield applications from
the kernel headers. But glibc does not support any interface to the capability
system.

To fix this one, I suggest you install new kernel headers on the compilation
machine, potentially taken from a 2.4.18 kernel.

> In file included from /usr/include/g++-2/alloc.h:21,
> from /usr/include/g++-2/std/bastring.h:39,
> from /usr/include/g++-2/string:6,
> from vutil.h:8,
> from chcontext.cc:17:
> /usr/include/g++-2/stl_alloc.h:320: parse error before `.'
> /usr/include/g++-2/stl_alloc.h:320: missing ';' before right brace
> /usr/include/g++-2/stl_alloc.h:322: parse error before `.'
> /usr/include/g++-2/stl_alloc.h: In function `size_t ROUND_UP(size_t)':
> /usr/include/g++-2/stl_alloc.h:325: parse error before `.'
> /usr/include/g++-2/stl_alloc.h:325: parse error before `.'
> /usr/include/g++-2/stl_alloc.h:326: warning: control reaches end of non-void function
> `ROUND_UP(size_t)'
> /usr/include/g++-2/stl_alloc.h: At top level:
> /usr/include/g++-2/stl_alloc.h:327: parse error before `private'
> /usr/include/g++-2/stl_alloc.h:331: parse error before `}'
> /usr/include/g++-2/stl_alloc.h: In function `size_t FREELIST_INDEX(size_t)':
> /usr/include/g++-2/stl_alloc.h:340: parse error before `.'
> /usr/include/g++-2/stl_alloc.h:341: warning: control reaches end of non-void function
> `FREELIST_INDEX(size_t)'
> /usr/include/g++-2/stl_alloc.h: In method `lock::lock()':
> /usr/include/g++-2/stl_alloc.h:382: `threads' undeclared (first use this function)
> /usr/include/g++-2/stl_alloc.h:382: (Each undeclared identifier is reported only once
> /usr/include/g++-2/stl_alloc.h:382: for each function it appears in.)
> /usr/include/g++-2/stl_alloc.h: In method `lock::~lock()':
> /usr/include/g++-2/stl_alloc.h:383: confused by earlier errors, bailing out
> make: *** [chcontext] Error 1
> linux10321:~/vserver/dist/vserver-0.17$
>
> Any ideas? Something odd seems to be going wrong with the `#include <string>' in
> vutils.h

I would say this is a bug in the STL headers. Which egcs package are you using ?

> The latest version I could compile on that machine was 0.13.
>
> On a later release of RedHat (7.1 instead of 6.2), it compiles fine.

---------------------------------------------------------
Jacques Gelinas <jack_at_solucorp.qc.ca>
vserver: run general purpose virtual servers on one box, full speed!
http://www.solucorp.qc.ca/miscprj/s_context.hc


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.4 : Mon Aug 19 2002 - 12:01:01 EDT