www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/04/11/14:47:10

Date: Tue, 11 Apr 1995 12:35:21 +0900
From: Stephen Turnbull <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
To: bob AT xnet DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: ignore most of my last...

Bob wrote:

   actually, i don't even remember if this should technically work,
   but here's what i did:

   class zb : public db{
     ...
     struct fstruct *node;
     ...
   }

   struct fstruct is define in "class db" which _is_ defined in an
   include earlier on.  changing it to:

   class zb : public db{
     ...
     struct db::fstruct *node;
     ...
   }

   fixes this segmentation fault.  i don't remember if you should be
   able to reference a structure defined in an inherited class or not,

If it's public or protected, you can.  If it's private, you shouldn't
be able to.  (The 'struct' means its data is exported to its context;
you need to look at the declaration of the enclosing class.)

Looks like you got snagged by a compiler upgrade.  The former syntax
was *required* in C++ 1; embedded classes were allowed for doing stuff
like

class device {

  enum ioctl_op {nop, init, flush, explode};
  ...
  }

but type ioctl_op and the constants nop, init, flush, and explode had
file scope (according to Stroustrup, "The C++ Programming Language",
and the ARM---didn't necessarily work for some compilers, eg,
Zortech).

   oh, and i found the functions i was looking for.  i guess i just
   really needed to know what the libraries are because libpc.a or
   libpc_p.a don't tell me much.  is there a listing of this sort
   somewhere?

Use 'nm <library>' to find out what's in the libraries, use 'grep
<function> /djgpp/include/*' to find out which header files contain
declarations of your function.  If you don't have a grep, the one
included with the JED editor (an Emacs clone, quite nice, but marks
and kills may be different from other Emaxen---watch out for user-
induced data lossage), rgrep, works well for me, and has a good built-
in help.  See /pub/jed at amy.tch.harvard.edu (I've had trouble with
my URLs lately, that might be tch.amy.harvard.edu).

-- 
Stephen Turnbull  /  Yaseppochi-gumi  /  <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
http://turnbull.sk.tsukuba.ac.jp/      anon FTP: turnbull.sk.tsukuba.ac.jp
Check out Kansai-WWW, too ------------> http://pclsp2.kuicr.kyoto-u.ac.jp/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019