Article View: gnu.gcc.bug
Article #89(none)
From: bonnavaud patrick
Date: Wed, 04 Nov 1992 11:48
Date: Wed, 04 Nov 1992 11:48
61 lines
1595 bytes
1595 bytes
Hello,
I'm a french developper and I use gcc to compile c++ code
but I've got a problem :
In the following code when I use static in this class
I have this bug in the phase of ld
Undefined:
_4CoOp$costPerShare
Would you please tell me who is wrong, me or gcc ?
I use the gcc 2.2.2 under ultrix4.2 mips decstation 5000/25
I compiled gcc without --with-gnu-ld option
When I compile gcc 2.2.2 with --with-gnu-ld option, I get trouble
in compiling the libg++ (2.2) at the check step.
Thank you for answering
Patrick
e-mail:patrick@xing.com
/* my Class */
class CoOp {
public:
static void raiseCost( double incr);
static double getCost() { return costPerShare; }
private:
static double costPerShare; // here is my probleme
int shares;
char *owner;
};
inline void CoOp::raiseCost(double incr)
{
costPerShare += incr;
}
/* main */
#include <iostream.h>
#include "CoOp.h"
main()
{
CoOp moi;
CoOp toi;
double val;
moi.raiseCost(100);
toi.raiseCost(200);
printf("cost %lf\n", CoOp::getCost() );
}
Technical Details
Message-ID:
<9211041148.AA01336@vfr.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!ogicse!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!xing.COM!patrickShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!xing.COM!patrick From: patrick@xing.COM (bonnavaud patrick) Newsgroups: gnu.gcc.bug Subject: (none) Message-ID: <9211041148.AA01336@vfr.com> Date: 4 Nov 92 11:48:35 GMT Article-I.D.: vfr.9211041148.AA01336 Sender: gnulists@ai.mit.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 61 Approved: bug-gcc@prep.ai.mit.edu