delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/09/27/23:27:44

Date: Tue, 27 Sep 1994 18:00:38 -0500 (CDT)
From: AARON UCKO <UCKO AT VAX1 DOT ROCKHURST DOT EDU>
Subject: Re: Troubles linking when using iomanip.h
To: cgg AT mundil DOT cs DOT mu DOT OZ DOT AU
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Organization: Rockhurst College; Kansas City, MO

> I'm having some trouble during linking when I try to use things from iomanip.h.
> I have this little test file:
>
> #include <iostream.h>
> #include <iomanip.h>
>
> int main()
> {
>	cout << '|' << setw(5) << 245 << '|' << endl;
>	return 0;
> }
>
> When I compile with gcc -Wall -o test test.cc -lgpp, I get the output
>
> test.cc(.text+0x42): undefined reference to `operator<<(ostream &, 
> smanip<int> const &)'
>
> Am I missing some library, or is something else going on?

Something else is going on....there is a problem in iomanip.h.  The declaration
of class omanip (or is it oapp?  I forget) is incorrect; change it to look like
the declaration of imanip (or iapp).  I presume dj will fix this bug in the
next maintenance release, but for now you'll have to change it yourself.  I
no longer have the original to make a patch file, but I can post the changed
block if necessary.

> One other little point.  Compiling a file using the _string.h header file in
> cplusinc/ with -Wall gives zillions of warnings.  I've fixed it by just putting
> `inline' in front of all the function declarations from line 400--446, but it
> seems a bit strange...?

I noticed this too, but I didn't investigate it that thoroughly.  Oh well.

- Raw text -


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