HDTenEightyP/NetNews huggingface dataset:
From: ron@cwi.nl (Ron Sommeling)
Newsgroups: gnu.g++.help
Subject: Rational class bug?
Date: 13 Apr 92 15:05:52 GMT
Distribution: gnu
Organization: CWI, Amsterdam

I'm trying to use the Rational class of GNU C++.
The following program gives a segmentation fault at execution time:
===============================================================================
#include <iostream.h>
#include <Rational.h>

main() {
  cout << Rational(2,3) << endl;
}
===============================================================================
% g++ -v t.cc
Reading specs from /usr/local/lib/gcc/sun4/2.0/specs
gcc version 2.0
 /usr/local/lib/gcc/sun4/2.0/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix t.cc /usr/tmp/cca29969.cpp
GNU CPP version 2.0 (sparc)
 /usr/local/lib/gcc/sun4/2.0/cc1plus /usr/tmp/cca29969.cpp -quiet -dumpbase t.cc -version -o /usr/tmp/cca29969.s
GNU C++ version 2.0 (sparc) compiled by GNU C version 2.0.
 as -o t.o /usr/tmp/cca29969.s
 ld -e start -dc -dp /lib/crt0.o -L/usr/local/lib/gcc/sun4/2.0/ -L/usr/local/lib/gcc/ -L/usr/local/lib/ t.o -lg++ -lgcc -lc -lgcc
% ./a.out
Segmentation fault

Does anyone know whether this is a library bug or a compiler bug?
It used to work with g++ 1.39.  Any help is appreciated.

Ron Sommeling <Ron.Sommeling@cwi.nl>
From: jbuck@forney.berkeley.edu (Joe Buck)
Newsgroups: gnu.g++.help
Subject: Re: static vals inside a class are unresolved (g++ 2.0/SunOS4.1.1)
Date: 10 Apr 1992 23:49:39 GMT
Organization: University of California, Berkeley
Distribution: gnu
NNTP-Posting-Host: forney.berkeley.edu

In article <MCCRORY.92Apr10161734@tomato.fnal.gov> mccrory@tomato.fnal.gov (Elliott McCrory) writes:
>Seems like a kludge.  Why has static been abandoned?

static has not been abandoned; the change in g++-2.0 is that the
compiler now implements what Ellis and Stroustrup specify in the ARM.
In the example, the code was buggy, even though it compiled and ran
under old g++.  The code might or might not have linked successfully
under cfront; it depends on whether the C compiler underneath enforces
the "one definition" rule or not.  That is, in some C compilers if
a bunch of different files declare

extern int foo;

then no one has defined foo: it's an undefined symbol.  In others,
a definition of foo with value zero will appear.  But the ANSI C
standard calls for a definition for each object: a conforming program
has to have "int foo;" somewhere.

In the same way, for each static class variable declared in the class
definition there must exist somewhere an initializer for that variable.
Many compilers kludge one up if none is specified by using the "common
block" technique, but this is contrary to the ARM (think of it as an
extension g++ no longer supports).

If you say

class Bar {
	...
};

class Foo {
	...
	static Bar fooStaticMember;
};

you must, in some source file that includes Foo's definition, say

Bar Foo::fooStaticMember;

If you want to give arguments to the Bar constructor, say

Bar Foo::fooStaticMember(arg1,arg2,...);

If it's an integer, and you want to give a value, say

int Foo::fooStaticInt = 3;

or some such.



--
Joe Buck	jbuck@ohm.berkeley.edu
From: allen@golem.ssc.gov (Mike Allen)
Newsgroups: gnu.g++.help
Subject: templates
Date: 16 Apr 92 15:21:29 GMT
Reply-To: Michael_Allen@ssc.gov
Distribution: gnu
Organization: SSC Laboratory, Dallas, TX

I am trying to use templates and am pretty thoroughly confused.  In
particular, I am confued about which code can be compiled into a
library and which has to be included into the source.  Can judicious
use of "#pragma interface" and "#pragma implementation" help?  Are
there good references on this?  (I have read the relevent ARM sections
a few times, so...)

-Thanks,
 Michael
--
===============================================================================
	German Chancellor Helmut Kohl, on the inauguration of Germany's first
Holocaust memorial, saying Germans must never forget Nazi atrocities:
	``(We) owe it to our children and grandchildren. We must pass on to
them the realization that it is not at all self-evident that one should
be allowed to live in peace and freedom.''
Newsgroups: gnu.g++.help,comp.lang.c++
From: andyrose@wet.UUCP
Subject: (none)
Organization: Gatewayed from the GNU Project mailing list help-g++@prep.ai.mit.edu
Date: Thu, 9 Apr 1992 09:31:37 GMT

Hello.  
I have received a g++ install tape and have put some 30 hours into 
installing it on a SGI personal IRIS.

.Changed Makefile for SysV. Also made changes from HINTS.  
Built gcc and it works.  g++ compiles.
After adding #define COLLECT at the beginning of tm-mips.h,
my main concern at the moment has to do with collect being unable to find
the routine mips_asm_file_start which exists in mips-output.c.  I'm also
unsure of the role crt1+ plays in all this.

As if by magic an executable 'collect' showed up although Make failed (?)
So I went ahead and built libg++ which had some problems also.  I
edited libg++/stdio.h to match /usr/include/stdio.h and #ifdef 0 some
code to get the library built.  When compiling hello_world.cc I get
ld: undefined 
environ
errno

I am sole programmer here so there's really nobody to ask but you.
My c++ professor who supplied the tape uses SUN C++ and will not get
involved (understandably).

Any suggestions appreciated, Mail would be fine, phone call would be great.

Thanks - Andy
415 495 5595

I would also like to subscribe to the mailer for g++ info.
From: scot@sioux.ugrad.ee.ufl.edu (Scott Miller)
Newsgroups: gnu.g++.help
Subject: g++ & HP-UX
Date: 9 Apr 92 21:18:09 GMT
Article-I.D.: eng.1992Apr9.211809.11063
Organization: UF EE Department

Has anyone compiled g++ for a HP9000/425 running
HP-UX 8.0. If so where can I get the modified source?

Regards,
Scott
From: tmcconne@sedona.intel.com (Tom McConnell)
Newsgroups: gnu.g++.help
Subject: Re: gcc 2.0 on rs/6000 ... huh?
Date: 12 Apr 92 18:51:22 GMT
Reply-To: tmcconne@sedona.intel.com
Distribution: usa
Organization: Intel Corporation, Embedded Microcomputer Division


In article <PAUL.92Apr1113852@ascent.UUCP>, paul@ascent (Paul Foley) writes:
> In article <PAUL.92Mar27121711@ascent.UUCP> paul@ascent (Paul Foley) writes:
> 
>    g++ 2.0 on an RS/6000 produces
> 
  <stuff deleted>
> 	#ifdef _AIX
> 	#define REAL_NM_FILE_NAME "/usr/ucb/nm"
> 	#endif
> in collect2.c to invoke a working nm.
> 
> --
> Paul Foley		UUCP: 		...!uunet!ascent!paul
> --			MIL/BITNET: 	paul%ascent@UUNET.UU.NET

  A better way to fix this is to modify ./gcc-2.1/config/xm-rs6000.h:
 
        /* This is the only version of nm that collect2 can work with.  */
        #define REAL_NM_FILE_NAME "/usr/ucb/nm"

  Just a my opinion :)

    Cheers,

    Tom McConnell
--
 Tom McConnell          |     Internet: tmcconne@sedona.intel.com
 Intel, Corp. C3-21     |     Phone: (602)-554-8229
 5000 W. Chandler Blvd. | The opinions expressed are my own. No one in 
 Chandler, AZ  85226    | their right mind would claim them.
Newsgroups: gnu.g++.help
From: tll@cco.caltech.edu (Tal Lewis Lancaster)
Subject: Re: static vals inside a class are unresolved (g++ 2.0/SunOS4.1.1)
Organization: California Institute of Technology, Pasadena
Distribution: gnu
Date: Sat, 11 Apr 1992 00:00:57 GMT

mccrory@tomato.fnal.gov (Elliott McCrory) writes:

>Seems like a kludge.  Why has static been abandoned?

Well, I got the idea of my so called "kludge" from p. 179 the ARM:

"A static member is not part of objects of a class.  Static members
of a global class have external linkage.  The declaration of a static
data member in its class declaration is NOT a definition.  A definition
is required elsewhere."

As a side note the "kludge" isn't needed when using ATT 3.0.

Tal
From: devin@frodo.colorado.edu (Sonja Orlavski)
Newsgroups: gnu.g++.help
Subject: Re: NeXT & libg++ 2.0
Date: 6 Apr 92 16:46:34 GMT
Article-I.D.: colorado.1992Apr6.164634.15036
Organization: Colorado Center for Astrodynamics Research

In article <1992Apr4.234030.8421@bosslogic.com>, zack@bosslog.com (Zacharias J. Beckman) writes:
|> Has anyone out there successfully compiled lib g++ 2.0, with gcc 2.1, on a
|> NeXT?  I've managed to get past "make src," but the "make install" fails with
|> the following output:
[deleted...]
|> ld: foo_main.o symbol 12 (___DTOR_LIST__) has unknown n_type field (0x16)
|> collect: /bin/ld returned 1 exit status
            ^^^^^^^

|> Help!  If you've got any ideas, I'd love to hear them!  Thanks in advance,

Try getting gnu ld (it's in the binutils package).

			-Devin

-- 
Devin Hooker     (RP90)     DoD #0034    devin@boulder.colorado.edu
"It's being both that's a bitch."
"I'm entirely TOO lucid right now."
"This howling in the distance, it's a captivating sound.
	Can't tell if it's ecstasy or pain..."  -DW
From: skohn@cs.ucsd.edu (Scott Kohn)
Newsgroups: gnu.g++.help
Subject: templates in g++
Keywords: code duplication
Date: 6 Apr 92 15:47:08 GMT
Followup-To: gnu.g++.help
Distribution: usa
Organization: UC-San Diego CSE Department


Sorry if this is a really stupid question, but here it goes:

 - Is there a way of getting one globally linkable instantiation
   of a template class?

Consider the following:

--- file foo.c ---

#include "array.h"
...
Array<int> a;
...
a.print();

--- file bar.c ---

#include "array.h"
...
Array<int> a;
...
a.print();

---------------

Now, both of the print member functions could potentially
share the same code.  However, the current g++ 2.0 implementation
generates local code only.  That is, g++ generates print() code in
foo.o and also generates print() code in bar.o -- even though the
code is identical (both are for an int template).

I'm writing a large template class and I would really like to avoid
this type of unnecessary code duplication.  Any suggestions?

Thanks...

-- Scott Kohn
Newsgroups: gnu.g++.help
From: mccrory@tomato.fnal.gov (Elliott McCrory)
Newsgroups: gnu.g++.help
Subject: Re: static vals inside a class are unresolved (g++ 2.0/SunOS4.1.1)
Date: 10 Apr 92 21:17:35 GMT
Distribution: gnu
Organization: Fermilab, Batavia, IL
In-reply-to: tll@cco.caltech.edu's message of 9 Apr 92 23:49:10 GMT

Seems like a kludge.  Why has static been abandoned?
--
  ||    Elliott McCrory, Ph. D.		| mccrory@tomato.fnal.gov (internet)
-/  \-  Fermi National Accelerator Lab	| ALMOND::MCCRORY	 (DECnet)
-\  /-  Batavia, IL  60510		| MCCRORY@FNALAD	 (BITnet)
  ||    708-840-4808			| linac!tomato!mccrory	 (uucp)
Newsgroups: gnu.g++.help
From: tl@bat.gsfc.nasa.gov (SSUID Tin Li)
Subject: stream.h and X11R4 Intrinsic.h 
Keywords: stream,X11R4
Organization: Century Computing Inc. 
Date: Wed, 15 Apr 1992 13:34:11 GMT

When I compile the following simple program using g++ 1.4 on sun4

#include <stream.h>
#include <X11/Intrinsic.h>
main ()
{
cout << "This is a test\n";
}

I got the warning flock was first declared as extern then static.
It seems g++ has a function prototype declared for flock in std.h and
system include file /usr/include/sys/fcntlcom.h declared flock as a
struct.

I have to include Intrinsic.h for my Xt stuff and like to use the stream
package instead of printf etc.  Does anyone have similar problem?
Is there any workaround?   I compiled the same program using Sun's C++ and
had received no warning.

Thanks in advance.

Tin Li
Century Computing Inc.
Laurel, MD

tl@cen.com    or  tl@bat.gsfc.nasa.gov

Newsgroups: gnu.g++.help
From: mrhagger@athena.mit.edu (Michael R Haggerty)
Subject: State of the art 386/486 g++ compilers
Organization: Massachusetts Institute of Technology
Date: Wed, 8 Apr 1992 18:43:26 GMT

What is the state of the art in 386/486 g++ compilers?  I've had a look at djgpp
but it seems to be an implementation of a rather old C++ standard (it claims to
be version 1.05)--it uses stream.h instead of iostream.h; it shows no sign of
templates, etc.  Is there a more recent version of djgpp?  Where can I find
documentation about the various version's capabilities?

    I am getting the emx package for OS/2 but won't be able to try it until my
copy of OS/2 2.0 appears in the mail (soon, I hope).  From the documentation I
can't tell if it even supports C++ or only C.

    So what is the most advanced Intel GNU C++ compiler, where can I get it, and
where is it documented?  Alternatively, I would be very grateful if someone would
simply tell me where to find out this information myself.

Thanks for your help,
Michael Haggerty
mrhagger@athena.mit.edu
Xref: sparky gnu.g++.help:635 gnu.gcc.help:1095 comp.unix.questions:6245 comp.unix.programmer:2423
From: yao@perform1.tti.com (David Yao)
Newsgroups: gnu.g++.help,gnu.gcc.help,comp.unix.questions,comp.unix.programmer
Subject: C compiler and debugger for AMD 29K
Keywords: Compiler, Debugger, AMD 29K
Date: 14 Apr 92 23:25:07 GMT
Reply-To: yao@perform1.tti.com (David Yao)
Followup-To: yao@perform1.tti.com
To: gnu-gcc-announce@pa.dec.com

Does anyone know about a Gnu C tool chain (i.e. C compiler+debugger) for
the AMD 29200 processors ?

How and where can I get a copy of it?


I appreciate any recommendations.


Cheers,

David Yao
Xref: sparky gnu.g++.help:614 gnu.gcc.help:1063
From: wrat@unisql.UUCP (wharfie)
Newsgroups: gnu.g++.help,gnu.gcc.help
Subject: g++ 2.0,gcc 2.1,gdb 4.4 for AIX 3.2
Date: 10 Apr 92 13:39:59 GMT
Reply-To: wrat@unisql.UUCP (wharfie)
Followup-To: gnu.g++.help
Distribution: gnu
Organization: UniSQL, Inc., Austin, Texas, USA


Dear gnu.* people,

	I was just handed a R/S 6000 running AIX and told "Put gnu*
on it".  Can some kind soul save me some work and {send me, point me}
at the necessary patches to get this stuff up?  I am not on Internet
and so have no access to ftp or other conveniences...

					Thanks in advance,

							wharfie

ps -

Lou Marco@Unisql, 512-343-7297

...!cs.utexas.edu!unisql!wrat
From: edstrom@Elmer.hsc.ucalgary.ca (John Edstrom)
Newsgroups: gnu.g++.help
Subject: out-of-bounds floats
Date: 13 Apr 92 15:15:15 GMT
Distribution: gnu
Organization: Neuroscience Division, U of Calgary School of Medicine, Calgary, Alberta, Canada

In the course of some calculations the printout reporting the values
for certain double variables comes out with Inf, -Inf, or NaN.

How does the formating routine flag the illegal doubles?  I need to
know in order to avoid some time consuming grinding on bad values.

John Edstrom | edstrom @ elmer.hsc.ucalgary.ca

--
 RM 2104, HSc Building,  Div. Neuroscience
 U. Calgary School of Medicine,  3330 Hospital Drive NW
 Calgary, Alberta       T2N 3Y4
 (403) 220 4493  (wk)
Newsgroups: gnu.g++.help,comp.lang.c++
From: kgiusti@chipcom.com (Ken Giusti)
Subject: Help with g++ 1.40.3 on a Sun 4 with os 4.1.1
Organization: Gatewayed from the GNU Project mailing list help-g++@prep.ai.mit.edu
Date: Mon, 13 Apr 1992 12:20:13 GMT

Folks,

	I've obviously made some major blunder during my installation
	of g++ (1.40.3).  While small programs compile and run OK,
	any program that uses the g++ library routines (eg, cout)
	crashes prior to main().  [the crash occurs in the do_fns
	routine in init.c.  The __CTOR_LIST__ list of constructor 
	functions contains invalid addresses and when do_fns tries
	to jump to these addresses ... core dump!].

	I'm installing g++ 1.40.3 with libg++ 1.39.  GAS 1.38 is
	installed already, and I'm installing the ld that comes with
	g++1.40.3.  I'm using the systems (not gnu's) crt0.c file.
	I'm building with source code from gcc 1.40.
	
	My system is a sun4 running 4.1.1.

	If anyone can send me a copy of a g++ Makefile that will
	work for the above system, or can offer any other insights
	on what I am doing wrong, I would greatly appreciate it!

Thanks in advance,

Ken Giusti (KGiusti@chipcom.com)

"Calling Powdered Toast Man... Calling Powdered Toast Man" - Stimpson J Cat.
From: bashford@scripps.edu (Don &)
Newsgroups: gnu.g++.help
Subject: Re: implicit member-wise assignment
Date: 17 Apr 92 06:44:59 GMT
Article-I.D.: zerbina.BASHFORD.92Apr16234459
Organization: Scripps Research Institute, La Jolla, CA, USA
In-reply-to: glipton@ajax.intel.com's message of 9 Apr 92 05:46:54 GMT

>>>>> On 9 Apr 92 05:46:54 GMT, glipton@ajax.intel.com (Gary Lipton) said:

Gary> That is, if I have a class "Foo", then the code

Gary>    Foo foo1, foo2;

Gary>    foo1 = foo2;

Gary> is legal, and will copy the members of foo1 into foo2, without
Gary> an explicit declaration of "=".

Gary> But I find that using g++, I would need the statement

Gary>   Foo operator=(Foo);

Gary> in my Class declaration for this code to compile.

That's funny.  I'm using gcc-2.1 on a Sparc running SunOS4.1.1
and implicit assignment works fine for me.  The code appended
to this message comiles fine with the command "g++ assig.cc"

By the way, the usual assingment operator is

  Foo& operator=(const Foo&);

Don Bashford
bashford@scripps.edu

--------------------------assig.cc------------------------------
class Pub {
public:
  int x, y;
  Pub(int xc, int yc) {x = xc; y=yc;}
};

class Priv {
private:
  int x, y;
public:
  Priv(int xc, int yc) {x = xc; y=yc;}
};

main() {
  Pub pub1(2,3);
  Pub pub2(4,5);
  pub2 = pub1;
  Priv priv1(5,6);
  Priv priv2(7,8);
  priv2 = priv1;
}
From: jds@m2c.org (John D. Sutter)
Newsgroups: gnu.g++.help
Subject: implicit member-wise assignment
Date: 10 Apr 92 04:05:31 GMT
Organization: Intel Corp, Chandler, AZ


 [ posted for a friend -- jds ]

I am just learning C++.  My references tell me that "=" is
implicitly defined as member-wise assignment between operands
of a given class.

That is, if I have a class "Foo", then the code

   Foo foo1, foo2;

   foo1 = foo2;

is legal, and will copy the members of foo1 into foo2, without
an explicit declaration of "=".

But I find that using g++, I would need the statement

  Foo operator=(Foo);

in my Class declaration for this code to compile.

Is there a way to get g++ to provide implicit assignment?  Or
am I on the wrong track entirely?

Please send replies to glipton@sedona.intel.com; our news access
has been shut down recently.  Thanks.
Newsgroups: gnu.g++.help,comp.lang.c++
From: atownley@mcs213k.cs.umr.edu
Subject: installation on a NeXT
Organization: Gatewayed from the GNU Project mailing list help-g++@prep.ai.mit.edu
Date: Thu, 16 Apr 1992 02:59:11 GMT

Hello,
	I have recently found the much wanted libg++-2.0 distribution  
file.  I have been pulling my hair out trying to get the AT&T 2.x  
stuff to work with my C++ programs.  Since I found this file though,  
I was wondering if there was anything special that I needed to know  
before installing it to my NeXT workstation.
	I noticed that there wasn't any listing in the config  
directory for next, and wondered what I needed to do to have the  
thing install correctly.  Also, since I just pulled the  
libg++-2.0.tar.Z file, could someone send me the texinfo.tex file  
that I need to get latex to work with the documentation files.

Thanks,

Andrew S. Townley
atownley@cs.umr.edu
(NeXTmail makes a nice change once in a while :)
From: jimu@cs.su.oz.au (James Uther)
Newsgroups: gnu.g++.help
Subject: allowing non-inline function parameters?
Date: 15 Apr 92 00:36:56 GMT
Reply-To: jimu@cs.su.oz.au (James Uther)


A nice easy question to get you warmed up for the day:-

I'm trying to compile some old C code with g++ 2.1. Gcc compiles the code 
fine, however g++ complains about the function parameters (having types
declared in the lines following the function header). How do I fix this?
(without rewriting the code).
	thanks for all the help
	James Uther
	jimu@cs.su.oz.au
From: pricep@handel.cs.colostate.edu (paul price)
Newsgroups: gnu.g++.help
Subject: parallel lib
Keywords: parallel lib
Date: 13 Apr 92 16:51:25 GMT
Distribution: usa
Organization: Colorado State University

I am looking for G++ libraries for parallel processing.
Does a lib exist with things like semaphores out there
anywhere?

Thanks in advance,
Paul Price
pricep@handel.cs.colostate.edu
From: jbuck@forney.berkeley.edu (Joe Buck)
Newsgroups: gnu.g++.help
Subject: Re: allowing non-inline function parameters?
Date: 14 Apr 1992 20:31:53 GMT
Organization: University of California, Berkeley
Distribution: world
NNTP-Posting-Host: forney.berkeley.edu

In article <4680@cluster.cs.su.oz.au>, jimu@cs.su.oz.au (James Uther) writes:
|> 
|> A nice easy question to get you warmed up for the day:-
|> 
|> I'm trying to compile some old C code with g++ 2.1. Gcc compiles the code 
|> fine, however g++ complains about the function parameters (having types
|> declared in the lines following the function header). How do I fix this?
|> (without rewriting the code).

The C++ language requires prototypes, so you can't get around this.
Fortunately there's a tool called "protoize" by Ron Guilmette (sorry
if I spelled your name wrong, Ron) that converts old-style C code
to C code with prototypes.  It's included in the gcc-2.1 distribution.
It's probably your best bet.


-- 
Joe Buck	jbuck@ohm.berkeley.edu
From: andyrose@wet.UUCP (Andrew Rose)
Newsgroups: gnu.g++.help
Subject: IRIS install
Date: 10 Apr 92 00:44:04 GMT
Organization: Wetware Diversions, San Francisco


Hello.  
I have received a g++ install tape and have put some 30 hours into 
installing it on a SGI personal IRIS.

.Changed Makefile for SysV. Also made changes from HINTS.  
Built gcc and it works.  g++ compiles.
After adding #define COLLECT at the beginning of tm-mips.h,
my main concern at the moment has to do with collect being unable to find
the routine mips_asm_file_start which exists in mips-output.c.  I'm also
unsure of the role crt1+ plays in all this.

As if by magic an executable 'collect' showed up although Make failed (?)
So I went ahead and built libg++ which had some problems also.  I
edited libg++/stdio.h to match /usr/include/stdio.h and #ifdef 0 some
code to get the library built.  When compiling hello_world.cc I get
ld: undefined 
environ
errno

I am sole programmer here so there's really nobody to ask but you.
My c++ professor who supplied the tape uses SUN C++ and will not get
involved (understandably).

Any suggestions appreciated, Mail would be fine, phone call would be great.

Thanks - Andy
415 495 5595

Newsgroups: gnu.g++.help
From: tll@cco.caltech.edu (Tal Lewis Lancaster)
Subject: Re: static vals inside a class are unresolved (g++ 2.0/SunOS4.1.1)
Organization: California Institute of Technology, Pasadena
Distribution: gnu
Date: Thu, 9 Apr 1992 23:49:10 GMT

mccrory@tomato.fnal.gov (Elliott McCrory) writes:

>How has the use of "static" changed since g++ 1.39?  I have a
>situation like this:

>% cat world.cxx
>#include <std.h>
>#include <stream.h>

>class Foo {
>  static int a;
> public:
>  Foo(int c) { a=c ; f=0.0; };
>  int b() { return a; };
>  static float f;
>};

// Explicit declarations for static members:
int Foo::a;
float Foo::f;


>int main(int argc, char* argv[])
>{
>  Foo A(1);
>  cout << A.b() << "Hello world\n" << A.f << "\n";
>}

>% make -k world
>g++  -g -Dsun4 -DEBUG -o world world.cxx
>world.cxx:7 (world.o): Undefined symbol __3Foo$a referenced from text segment
>world.cxx:7 (world.o): Undefined symbol __3Foo$a referenced from text segment
>world.cxx:7 (world.o): Undefined symbol __3Foo$f referenced from text segment
>world.cxx:7 (world.o): Undefined symbol __3Foo$f referenced from text segment
>world.cxx:8 (world.o): Undefined symbol __3Foo$a referenced from text segment
>world.cxx:8 (world.o): Undefined symbol __3Foo$a referenced from text segment
>world.cxx:15 (world.o): Undefined symbol __3Foo$f referenced from text segment
>world.cxx:15 (world.o): Undefined symbol __3Foo$f referenced from text segment
>*** Error code 1
>make: Warning: Target `world' not remade because of errors

The problem is that all static members must be declared outside of the
class scope. I don't know if they need to have global linkage but that is
usually how I do it. But the code that I added above should work

>Compilation finished at Thu Apr  9 16:13:14

>Thanks in advance.
>--
>  ||    Elliott McCrory, Ph. D.		| mccrory@tomato.fnal.gov (internet)
>-/  \-  Fermi National Accelerator Lab	| ALMOND::MCCRORY	 (DECnet)
>-\  /-  Batavia, IL  60510		| MCCRORY@FNALAD	 (BITnet)
>  ||    708-840-4808			| linac!tomato!mccrory	 (uucp)

Tal Lancaster