HDTenEightyP/NetNews huggingface dataset:
From: hilfingr@tully.cs.berkeley.edu (Paul N. Hilfinger)
Newsgroups: gnu.g++.bug
Subject: Member function overloading
Date: 25 Jan 1993 20:29:30 -0500
Organization: GNUs Not Usenet
Distribution: gnu

In at least versions 1.39, 2.2.2, and 2.3.3 of g++/gcc (for the Sun),
the attached program compiles without comment.  My understanding is
that, on the contrary, the definition of I::f should hide, rather than
overload, that of H::f, making the calls f() and x.f() illegal.

P. Hilfinger

---------------------------- cut here ---------------------------
class H {
public:
    int f();
};

class I : public H {
public:
    int f(double) { return f(); }
};

int main()
{
    I x;
    return x.f();
}

Newsgroups: gnu.g++.help
From: jjo619@csc.albany.edu (John O'neill)
Subject: How to load sqrt function with g++
Organization: State University of New York at Albany
Date: 22 Jan 93 01:52:36

I cannot link(load) a program that calls log and sqrt.  I started looking 
at the Normal distribution from libg++ and it calls log and sqrt.

My problem is that I get undefined symbols.  Ive tried:
-lm -lgcc

How do you compile programs with math calls ?
Im running g++ 2.2.(2?) and libg++ 2.2.2 on Decstation 5000/240.

Thanks,
	John O'Neill
From: monta@image.mit.edu (Peter Monta)
Newsgroups: gnu.g++.help
Subject: Making libg++-2.3: include file confusion?
Date: 26 Jan 93 17:23:33 GMT
Organization: MIT Advanced Television Research Program

I'm trying to make libg++-2.3 on a Sun-4 under SunOS 4.1.1.
"configure sun4os4" goes normally, but when make starts compiling,
there's apparently some mixup among the include file directories:

----------------
gcc -g -O -nostdinc++ -I.. -I. -I./../iostream -I./../g++-include  -c AllocRing.cc
In file included from ./../g++-include/sys/types.h:15, from /usr/include/unistd.h:72, from ./../g++-include/unistd.h:25, from ./std.h:28, from AllocRing.cc:22:
/usr/include/sys/types.h:24: conflicting types for `wchar_t'
./../g++-include/stddef.h:11: previous declaration of `wchar_t'
*** Error code 1
make: Fatal error: Command failed for target `AllocRing.o'
----------------

Seems to me /usr/include/unistd.h should get /usr/include/sys/types.h,
not the g++-include one.  Am I missing something obvious?  Thanks for
any help.

Peter Monta   monta@image.mit.edu
MIT Advanced Television Research Program
From: ecm9093@aston.ac.uk (J.P.FLETCHER)
Subject: G++ name mangling
Organization: Aston University
Date: Mon, 25 Jan 1993 13:29:38 GMT

Is there a document which discusses the name mangling scheme in G++.
I have looked in the FAQ here.

Thanks
John
--------------------------------------------------------------
Dr John P. Fletcher       
Department of Chemical Engineering and Applied Chemistry,
Aston University,         Tel: (44) 21 359 3611 ext 4625
Aston Triangle,		  Email(Janet): J.P.FLETCHER@UK.AC.ASTON
BIRMINGHAM B4 7ET   U.K.  Email(Other): J.P.FLETCHER@ASTON.AC.UK
--------------------------------------------------------------
Newsgroups: gnu.g++.help
From: lonnblad@thnextb.SLAC.Stanford.EDU (Leif Lonnblad)
Subject: Re: Problem linking with g++ class
Organization: Stanford Linear Accelerator Center
Date: Tue, 26 Jan 1993 18:43:53 GMT



I think your problem is the '#pragma interface' directive in the
mpf14.h file. Among other things this instructs gcc not to produce
code for inline functions defined in this file, unless there is a
corresponding '#pragma implementation' directive in the '.c' file
currently beeing compiled. (do 'man gcc' for details)

This should not matter if all the inline functions actually were
compiled inline, but as you haven't declared them inline in the class
declaration, they will not even be considered for inlining by gcc (I
guess it would be appropriate if gcc warned about this).


Leif

---------------------------------------------------------------
Leif Lonnblad, DESY (-T-), Notkestr. 85, 2000 Hamburg 52, FRG
phone: +49-40-8998-2048,  fax: +49-40-8998-2777              
e-mail: <lonnblad@ips102.desy.de>, <leif@thep.lu.se>
From: jbuck@forney.berkeley.edu (Joe Buck)
Newsgroups: gnu.g++.help
Subject: Re: Library Reference Manual
Date: 22 Jan 1993 01:30:38 GMT
Organization: U. C. Berkeley
NNTP-Posting-Host: forney.berkeley.edu

In article <1993Jan21.205806.663@murdoch.acc.Virginia.EDU> cpr4k@holmes.acc.Virginia.EDU (Christian P. Roberts) writes:
>How can I obtain a copy of the G++ Library Reference Manual.
>I untarred the file from prep.ai.mit.edu and found a file
>named libg++.texinfo, from which you are supposed to be able
>to get Emacs-type info files and TeX source from which to
>get a hardcopy.  How do you get this texinfo file to split?

Get the "texinfo" distribution from prep or some other GNU archive
site.  It has the TeX macros, the "makeinfo" program for making
info files, and an info reader that can be used instead of, or
in addition to, Emacs to hop around in the info file.




--
Joe Buck	jbuck@ohm.berkeley.edu
Newsgroups: gnu.g++.help
From: klamer@mi.el.utwente.nl (Klamer Schutte)
Subject: Re: help!
Keywords: Linker, ld, collect
Organization: University of Twente, BSC-El
Date: Wed, 27 Jan 1993 13:30:03 GMT

In <7684@sersun1.essex.ac.uk> palmm@csc2.essex.ac.uk (Palmer M J) writes:

	>> dicussion about linked list implementation deleted <<

The problem you have is in the concept string. You expect the behaviour
of a decent string, and you use char *.

You get the expected behaviour by using the String type defined by
#include <String.h>. Just change your typedef line to:
   typedef String Type;
instead of
   typedef char * Type;

Klamer
--
Klamer Schutte			Tel: +31-53-892778	Fax: +31-53-340045
Faculty of electrical engineering -- University of Twente, The Netherlands
preferred: klamer@mi.el.utwente.nl     SMTP: klamer@utelmi01.el.utwente.nl
From: palmm@csc2.essex.ac.uk (Palmer M J)
Newsgroups: gnu.g++.help
Subject: help!
Keywords: Linker, ld, collect
Date: 25 Jan 93 14:00:00 GMT
Reply-To: palmm@essex.ac.uk (Palmer M J)
Organization: University of Essex, Colchester, UK

I've recently been trying to get to grips with c++. I wrote the following
small programme to implement a list template. However, it does not behave as
I would have expected. If I define a list of chars or ints in main then all is
ok. But defining the list to be of type char* does not work. If I insert a
string item by typing 
   i aaa
then insert another string by typing
   i bbb
then type 
   d
to display the contents of the list, it prints out
   bbb bbb
If I then type
   s ccc
and then
   d
then what is printed out is 
   ccc ccc ccc
It seems that by reading in a string to the local char array item in main
causes the value of each element in list to be changed to the value of the
newly read in string. Could someone please put me out of my misery explain
what is going on.

Thanks in advance.
Mike Palmer.

PS. I am using gcc version 2.2.2

//////////////////////////////////////////////////////////////////////////////
// List template definition
//////////////////////////////////////////////////////////////////////////////
#include <assert.h>
#include <iostream.h>

enum Boolean { false = 0, true = 1 };
template <class Type> class Item;

template <class Type> 
class List {
   public:
      List() { firstItem = 0; }
      ~List() {}
      void insert(Type);
      void display();
   private:
      Item<Type> *firstItem;
};

template <class Type> 
class Item {
   friend class List<Type>;
   private:
      Item(Type value) { val = value; next = 0; }
      Type val;
      Item *next;
};

template <class Type> 
void List<Type>::insert(Type val) {
   Item<Type> *pt = new Item<Type>(val);
   assert( pt != 0 );   // catch free store exhaustion
   pt->next = firstItem;
   firstItem = pt;
}


template <class Type> 
void List<Type>::display() {
   for ( Item<Type> *pt = firstItem; pt; pt = pt->next )
      cout << pt->val << " ";
   cout << endl;
}

//////////////////////////////////////////////////////////////////////////////
// Define and test a list of strings.
////////////////////////////////////////////////////////////////////////////// 
main () { 
   typedef char *Type;	
   List<Type> *list = new List<Type>; // create a list of strings
   char ch; 		// select test operation
   char  item[10];	// input string buffer
   while ( cin >> ch )
      switch(ch) {
	 case 'q':
	    return 1;
	 case 's':
            cin >> item;
            cout << item << '\n';
	    break;
         case 'i':
            cin >> item;
            list->insert(item);
            break;
         case 'd':
            list->display();
            break;
      }
}
Newsgroups: gnu.g++.help
From: jas@dcs.warwick.ac.uk (Jason Morris)
Subject: Debugging multiple processes
Organization: Department of Computer Science, Warwick University, England
Date: Thu, 28 Jan 1993 15:12:26 GMT


  Anyone know how to use gdb() with more than one process (e.g. parent and
child) ? I've tried getting the processes up and running and then using
"attach", but I just get:

       "Can't attach to a process on this machine."

  Any ideas how to get it running so you are debugging the child? The parent
is easy as fork() always returns the pid of the child.

    Jas.
From: jacob@informix.com (Jacob Salomon)
Newsgroups: gnu.g++.help
Subject: Repost with correction (Was: Re: So close and yet, so far...)
Keywords: collect link
Date: 22 Jan 93 14:57:14 GMT
Organization: Informix Software, Inc.
Originator: jacob@cheetah

Apologies on the muysterious problem - I had omitted a vital "not"
from the  description of my situation, resulting in nonsense. Here is
the correction; note the *not* in the paragraph beginning with the
word "Unfortunately":

In article <1993Jan21.004406.6508@informix.com>  I asked for help
regarding why, after finally getting a clean compile of gcc-2.3.3 the
compiler was unable to automatically find <iostream.h>; I was forced
to supply the directory in the -I option to g++.  When I did this the
compile completed the linker (or more accurately, collect) complained 
it was unable to find libg++.a (library for -lg++).  I got back some
important answers:

Mr. DM and AG (names witheld to protect their mailboxes ;) both replied
that I had needed to supply a --prefix parameter to the configure
command for both gcc and libg++.  Furthermore, the target directory
must be the same for both configure commands.

Unfortunately, this is documented only in the libg++ README, not in
the gcc readme (I just ran a grep on it; it isn't there!) and I really
had *not* used the --prefix in the configure on gcc.  Short of going
through all that building again (remembering to drop the -g from all
Makefiles and uncommenting/commenting for various models! UGH!) what
can I do to make use of everything where it is?

Mr. JO to the partial rescue:  Here is his reply:

>I set up libg++ on decstation 5000/240 running Ultrix 4.?
>To search the various files the following env var are needed (for me)
>COMPILER_PATH (sound ok for you)
>LIBRARY_PATH  ( I think you need this )
>CPLUS_INCLUDE_PATH ( for includes )

Well, I set up the CPLUS_INCLUDE_PATH to reference where I had put
the include directory: /usr/gnu/lib/g++-include .. This helped it find
the <iostream.h> without my supplying the -I switch to g++.  However
the LIBRARY_PATH did not help the linker (or collect) find libg++.a,
no matter where I aimed it.  BTW, the directory gcc-lib is under
/usr/local/lib.

Thanks to all who sent me the help so far.  I'm almost there with only
one screw-up along the way.

C'mon Netters, please help hack my way around that screw-up!  As
before, please reply be e-mail.

Thanks again.

		-- Jake Salomon
		jacob@informix.com
-- 
----------------Obligatory smart-$$$ remark:---------------------
| There's two kinds of people: Those who categorize people into |
| two groups and those who don't.   (Barth's Aging proverb.)    |
-----------------------------------------------jacob@informix.com
Newsgroups: gnu.g++.help
From: hmchang@eecs.nwu.edu (Hao-Ming Chang)
Subject: Building xxgdb by g++ ?
Organization: EECS Department, Northwestern University, Evanston, Il., USA
Date: Mon, 25 Jan 1993 19:38:05 GMT

Does anyone know how to build xxgdb by g++ compiler(how to compile
xxgdb source codes using g++) ? What kind of modification should be done
on xxgdb source codes ?
Any help will be appreciated !
From: brinerj@mcduff.uncg.edu (Jack V. Briner Jr.)
Newsgroups: gnu.g++.help
Subject: new operator with multiple arguments (gcc-2.2.2)
Date: 22 Jan 93 21:24:50 GMT
Reply-To: brinerj@mcduff.uncg.edu (Jack V. Briner Jr.)
Organization: UNCG Department of Mathematics

I would like to pass arguments to the new operator (to select memory from
different segments).  g++ does not seem to have this implemented under gcc-2.2.2.  Here is some example code that compiles fine under cfront.  Does a
newer release accept this code?

Thanks,
Jack


#include <iostream.h>
#include <stddef.h>
class t {
public:
        int i; 

        // ok
	void *operator new(size_t sz) {
             t *n;
             n = (t *)new char[sz];
             return n;
             }

        // not ok when used in main
	void *operator new(size_t sz,int i) {
             t *n;
             n = (t *)new char[sz];
             n->i = i;  // not what I am really doing in my application
             return n;
             }

};

main () {
   
   t *a = new t; // ok
   t *b = new(5) t; // not ok,  parse error before `5'
}
  


--
Jack V. Briner,Jr.		Department of Mathematics
brinerj@mcduff.uncg.edu		University of North Carolina at Greensboro
brinerj@steffi.uncg.edu		Greensboro, NC 27412
brinerj@UNCG.Bitnet		(919)334-5836
Newsgroups: gnu.g++.help
From: fritz@mtl.mit.edu (Frederick Herrmann)
Subject: #pragma implementation
Organization: MIT Microsystems Technology Laboratories
Distribution: gnu
Date: Fri, 22 Jan 1993 06:08:51 GMT

The message:
		 `#pragma implementation' can only appear at top-level

is generated if the #pragma appears after a #line.  That makes sense
most of the time, but is causing me some problems now because I want to
put the pragma in the declaration section of bison deck.  Bison puts a
#line control right at the top of the file.

Of course, I can run bison -l and suppress all the #lines, but this
makes the compiler messages more confusing.

Since bison already has all the #ifdef __cplusplus conditionals in the
parser, I figured somebody might have run into this before and have a
suggestion.  Other than this, bison output seems to work fine with
c++.

				- Fritz
				  fritz@mtl.mit.edu
From: q05832@pbhrzx.uni-paderborn.de (Norbert Schmitz)
Newsgroups: gnu.g++.help
Subject: probs linking with g++
Date: 25 Jan 93 12:22:26 GMT
Organization: Uni Paderborn FB 17 Informatik GERMANY
NNTP-Posting-Host: pbhrzx.uni-paderborn.de

hello,

I have a problem with linking object-files and libraries. each time I try
to link an object-file to the g++ library , the linker says that there
are some unknown funktion ..

what did i make wrong ??

greetings norbert
From: keith@msmri.med.ubc.ca
Newsgroups: gnu.g++.help
Subject: Problem linking with g++ class
Date: 26 Jan 93 14:54:58 GMT
Organization: University of British Columbia, Vancouver, B.C., Canada
NNTP-Posting-Host: msmri.med.ubc.ca


I am having difficulties linking to a very simple class with g++.
The program compiles, links and runs properly with BC++ 3.1.  
I am running gcc 2.3.3 
with libg++ 2.3 on a SUN OS 4.1.1.  Gcc is installed in a directory
other than /usr/local. 

I have tried to make the class as simple as possible and based its 
design on Complex.h in libg++.  I have tried a similiar test program
with the Complex.h class and it compiled, linked and ran properly with
g++.  The 2 test files and the class I am trying to link to are 
included at the end of this file.

When I type the command

    g++ test1.c test2.c -lm

I get the error message

    ld: Undefined symbol 
       ___7mpfloatRC7mpfloat 
       ___7mpfloatd 
       ___ml__FRC7mpfloatT0 
       __$_7mpfloat 
    collect: /usr/bin/ld returned 2 exit status

I am obviously missing something simple.  Could someone please point
it out to me.

Thanks in advance.

Keith S Cover
Physics, UBC
keith@msmri.med.ubc.ca

test1.c
=======

#include <iostream.h>
#include <math.h>
#include "mpf14.h"

mpfloat square(mpfloat a);

main() {

    mpfloat a = 4;
    mpfloat b = square(a);

    return 0;
}


test2.c
=======

#include "mpf14.h"

mpfloat square(mpfloat a) {

    return( a*a );

}


mpf14.h
=======

#ifndef _mpfloat_h
#ifdef __GNUG__
#pragma interface
#endif
#define _mpfloat_h 1


// INCLUDE FILES 
#include <iostream.h>
#include <math.h>
#include <stdlib.h>


class mpfloat {

protected:

    double num;

public:

    // constructors and destructors
    mpfloat();
    mpfloat(const mpfloat& x);
    mpfloat(const double x);
    ~mpfloat();

    // get value
    double getnum() const;

};


// INLINE FUNCTION PROTOTYPES

// Arithmetic operators
mpfloat operator * ( const mpfloat& x, const mpfloat& y);

// INLINE MEMBERS

// constructors
inline mpfloat::mpfloat() {
}
inline mpfloat::mpfloat(const mpfloat& x) :num(x.getnum()) {
}
inline mpfloat::mpfloat(const double x) {
    num = x;
}
inline mpfloat::~mpfloat() {
}


// Get number
inline double mpfloat::getnum() const {
    return(num);
}


// Inline Functions

inline mpfloat operator * ( const mpfloat& x, const mpfloat& y) {
    return mpfloat( x.getnum()*y.getnum() );
}

#endif // _mpfloat_h
From: corrigan@weber.ucsd.edu (Michael J. Corrigan)
Newsgroups: gnu.g++.help
Subject: How do I turn a .cc file into a .c file
Date: 28 Jan 1993 02:30:41 GMT
Organization: University of California, San Diego
NNTP-Posting-Host: weber.ucsd.edu

When I used
g++ -c -save-temps  or
gcc -c -save-temps  or
gcc -c -E  

on a .cc file, the .i file still looks like C++ ( classes, extern "C" stuff ).
Is this really C code ? If not, can I get preprocessed C from a .cc file
using g++/gcc  ( or anything else )
Thanks for any information.
-mike
Xref: sparky gnu.g++.help:1714 comp.lang.c++:20059
From: ram@magnum.UUCP (P)
Newsgroups: gnu.g++.help,comp.lang.c++
Subject: (none)
Date: 28 Jan 1993 03:38:13 -0500
Organization: Gatewayed from the GNU Project mailing list help-g++@prep.ai.mit.edu
Distribution: world

date : 23.01.93
time : 15.00 hrs

To
	Free Software Foundation


		Why Destructors are not called for STATIC objects that are 
created by routines called from a C program. (Ofcourse those routines
are compiled by g++ compiler). I have this problem while linking C++
object files to C. I kindly request you to give a solution to this
problem.

	I would like to know the address where I can get
the source code for gcc and g++ compilers (for IRIS).


						Yours Sincerely
							
							K.Ramesh

My E-mail address:

	ram@magnum.barct1.errnet.in

______

ram@magnum.barct1.ernet.in
From: jacob@informix.com (Jacob Salomon)
Newsgroups: gnu.g++.help
Subject: Re: So close and yet, so far...
Keywords: Linker, ld, collect
Date: 21 Jan 93 23:02:09 GMT
Organization: Informix Software, Inc.

In article <1993Jan21.004406.6508@informix.com>  I asked for help
regarding why, after finally getting a clean compile of gcc-2.3.3 the
compiler was unable to automatically find <iostream.h>; I was forced
to supply the directory in the -I option to g++.  When I did this the
compile completed the linker (or more accurately, collect) complained 
it was unable to find libg++.a (library for -lg++).  I got back some
important answers:

Mr. DM and AG (names witheld to protect their mailboxes ;) both replied
that I had needed to supply a --prefix parameter to the configure
command for both gcc and libg++.  Furthermore, the target directory
must be the same for both configure commands.

Unfortunately, this is documented only in the libg++ README, not in
the gcc readme (I just ran a grep on it; it isn't there!) and I really
had used the --prefix in the configure on gcc.  SHort of going through
all that building again (remembering to drop the -g from all Makefiles
and uncommenting/commenting for various models! UGH!)  what can I do
to make use of everything where it is?

Mr. JO to the partial rescue:  Here is his reply:

>I set up libg++ on decstation 5000/240 running Ultrix 4.?
>To search the various files the following env var are needed (for me)
>COMPILER_PATH (sound ok for you)
>LIBRARY_PATH  ( I think you need this )
>CPLUS_INCLUDE_PATH ( for includes )

Well, I set up the CPLUS_INCLUDE_PATH to reference where I had put
the include directory: /usr/gnu/lib/g++-include .. This helped it find
the <iostream.h> without my supplying the -I switch to g++.  However
the LIBRARY_PATH did not help the linker (or collect) find libg++.a,
no matter where I aimed it.  BTW, the directory gcc-lib is under
/usr/local/lib.

Thanks to all who sent me the help so far.  I'm almost there with only
one screw-up along the way.

C'mon Netters, please help hack my way around that screw-up!  As
before, please reply be e-mail.

Thanks again.

		-- Jake Salomon
		jacob@informix.com
-- 
----------------Obligatory smart-$$$ remark:---------------------
| There's two kinds of people: Those who categorize people into |
| two groups and those who don't.   (Barth's Aging proverb.)    |
-----------------------------------------------jacob@informix.com
From: duperval@ERE.UMontreal.CA (Duperval Laurent)
Newsgroups: gnu.g++.help
Subject: How to compile libg++ with non-standard installation?
Date: 22 Jan 93 21:53:02 GMT
Distribution: na
Organization: Universite de Montreal

Hello there,

I'm really frustrated trying to install libg++ using a non-standard
installation.  I'm installing it on an SGI running Irix 4.x.x.  I have a
temporary installation that I'm using until I'm sure everything works OK.
After that I'm going to install it in /usr/local.

The problem is that no matter what I've tried (short of going through every
subdir manually), I always get caught with an error because gcc isn't
installed properly.

How can I use configure and tell it that gcc is really

gcc -B/foo/bar/lib/gcc-lib/ ?

Or do I _have_ to install gcc in /usr/local and then try to compile libg++?
Any help in that department would be really helpful

Thank you.

-- 
Laurent Duperval, B. Sc.  | The opinions expressed herein are my own and
                          | do not represent those of this establishment
duperval@ere.umontreal.ca | That's because they don't have enough $$$
duperval@jsp.umontreal.ca | to afford them.  Noone does.
From: brendan@cygnus.com (Brendan Kehoe)
Newsgroups: gnu.g++.help
Subject: Re: Is someone working on better template support?
Date: 23 Jan 93 01:20:24 GMT
Reply-To: brendan@cygnus.com (Brendan Kehoe)
Organization: Cygnus Support, Mountain View, CA
In-reply-to: wolf@merlin.mt.att.com's message of Wed, 20 Jan 1993 13:30:32 GMT

In article <1993Jan20.133032.17324@cbnewsh.cb.att.com> wolf@merlin.mt.att.com (Thomas Wolf) writes:

   I recently asked why my template-based class library won't link when I compile/link
   with g++/gcc but will compile/link fine when I do the same with AT&T's CC.
   If I read the replies correctly, it is a compiler limitation in that
   the compiler doesn't do multiple passes for template instantiation.  People
   suggested all sorts of workarounds - all of which seemed to involve some source
   creation/modification.  Being a lazy programmer (but good s/w engineer :-) I'm
   hoping that someone is already buzily working on fixing this deficiency.  Could
   someone tell me if there is something in the works?  Or at least dash my hopes?

Yes, between April and June we hope to be able to say that template
support has been drastically improved (along with some other things,
like exception handling and proper overloading resolution).

Brendan
--
Brendan Kehoe                                               brendan@cygnus.com
Cygnus Support, Mountain View, CA                              +1 415 903 1400
Newsgroups: gnu.g++.help