🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by bonnavaud patrick Wed, 04 Nov 1992 11:48
(none)
#89
Author: bonnavaud patrick
Date: Wed, 04 Nov 1992 11:48
61 lines
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() );
}
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads