This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project. See the libstdc++ home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

what am I doing wrong?





Hello, all.

I'm trying to install and use the 2.90.1 snapshot, purely because the 
[io]streambuf_iterators are implemented, on a Solaris 2.6 system using egcs 
1.1.  Downloaded the library today and it built okay, but I never got as far 
as linking against the resulting files.

The "make install" only copies the libraries, not the include files, so I 
hand-copied the contents of ./std and ./stl into /usr/local/v3/include, and 
the contents of ./bits and ./stl/bits into /usr/local/v3/include/bits.  I 
/think/ that should be okay, based on the README.

I put -I/usr/local/v3/include at the front of the include path and tried to 
compile a source file using the streambuf_iterators, but it never got that 
far.  The output of script(1) is below.

The only thing that may appear out of place is that I use a -specs option to 
g++, just to have a bunch of warning levels enabled without seeing the 
options themselves take up space on the screen.  This has not caused any 
problems with egcs, and the contents of "philspecs" are included below as 
well.

Any tips would be appreciated.  The output using -E instead of -c is just 
over half a meg, but I'll keep it in case it needs to be examined.  I can't 
see anything obviously wrong with it.



I've also experimented with just using <iterator> and its dependant files, 
without the -I including the rest of the v3 distribution.  This doesn't work 
either.


In the meantime, I tried using istream_iterator and ostream_iterator. 
 However, I lose the whitespace during copying, and I can't have that, so 
that'll be removed as soon as I can think of a replacement.  The idea is to 
quickly and completely portably copy a file, so what I want, ideally, is

	// given an ifstream& IN and ofstream& OUT for this email
	copy (istreambuf_iterator (IN),
	      istreambuf_iterator (),
	      ostreambuf_iterator (OUT));

I know there are only about a million ways to copy a file "completely 
portably" in C++, but I was hoping for something short and elegant.  :-)


Thanks for your time!


--
/dev/phil            Ball Aerospace & Technologies Corp.
pedwards@ball.com    Advanced Systems & Technology Operations
(937-320-4048)



Script started on Wed Oct 28 17:54:45 1998
% g++ -v -c -fPIC -specs=../philspecs -I/usr/local/v3/include -I../include 
SCEN_Writer.cc
Reading specs from 
/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/specs
Reading specs from ../philspecs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/cpp -lang-c++ -v 
-I/usr/local/v3/include -I../include -undef -D__GNUC__=2 -D__GNUG__=2 
-D__cplusplus -D__GNUC_MINOR__=91 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 
-D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun 
-D__unix -Asystem(unix) -Asystem(svr4) -D__EXCEPTIONS -D__GCC_NEW_VARARGS__ 
-Acpu(sparc) -Amachine(sparc) SCEN_Writer.cc /tmp/ccDDWndi.ii
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/v3/include
 ../include
 /usr/local/include/g++
 /usr/local/include
 /usr/local/sparc-sun-solaris2.6/include
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/cc1plus 
/tmp/ccDDWndi.ii -W -Wall -Woverloaded-virtual -Winline -Wundef 
-Wpointer-arith -Wconversion -quiet -dumpbase SCEN_Writer.cc -version -fPIC 
-o /tmp/ccHfV8sw.s
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release) 
(sparc-sun-solaris2.6) compiled by GNU C version egcs-2.91.57 19980901 
(egcs-1.1 release).
/usr/local/v3/include/bits/char_traits.h: In function `static size_t 
__char_traits_base<_CharT,_IntT>::length(const _CharT *)':
In file included from /usr/local/v3/include/bits/std_iterator.h:37,
                 from /usr/local/v3/include/bits/std_ios.h:27,
                 from /usr/local/v3/include/bits/std_fstream.h:23,
                 from /usr/local/v3/include/fstream:2,
                 from SCEN_Writer.cc:13:
/usr/local/v3/include/bits/char_traits.h:45: parse error before `__null'
/usr/local/v3/include/bits/ios_base.h: At top level:
In file included from /usr/local/v3/include/bits/std_ios.h:38,
                 from /usr/local/v3/include/bits/std_fstream.h:23,
                 from /usr/local/v3/include/fstream:2,
                 from SCEN_Writer.cc:13:
/usr/local/v3/include/bits/ios_base.h:102: syntax error before `;'
/usr/local/v3/include/bits/ios_base.h:103: syntax error before `;'
/usr/local/v3/include/bits/ios_base.h:144: warning: ANSI C++ forbids 
declaration `streamsize' with no type
/usr/local/v3/include/bits/ios_base.h:144: `streamsize' declared as an 
`inline' field
/usr/local/v3/include/bits/ios_base.h:144: parse error before `('
/usr/local/v3/include/bits/ios_base.h:145: warning: `inline' is not at 
beginning of declaration
/usr/local/v3/include/bits/ios_base.h:145: syntax error before `('
/usr/local/v3/include/bits/ios_base.h:146: syntax error before `('
/usr/local/v3/include/bits/ios_base.h:147: syntax error before `('
/usr/local/v3/include/bits/ios_base.h:151: non-member function `getloc()' 
cannot have `const' method qualifier
/usr/local/v3/include/bits/ios_base.h: In function `class locale getloc()':
/usr/local/v3/include/bits/ios_base.h:151: warning: implicit declaration of 
function `int _M_getloc(...)'
/usr/local/v3/include/bits/ios_base.h:151: conversion from `int' to 
non-scalar type `locale' requested
/usr/local/v3/include/bits/ios_base.h: At top level:
/usr/local/v3/include/bits/ios_base.h:152: non-member function `_M_getloc()' 
cannot have `const' method qualifier
/usr/local/v3/include/bits/ios_base.h: In function `const class locale & 
_M_getloc()':
/usr/local/v3/include/bits/ios_base.h:152: `_M_locale' undeclared (first use 
this function)
/usr/local/v3/include/bits/ios_base.h:152: (Each undeclared identifier is 
reported only once
/usr/local/v3/include/bits/ios_base.h:152: for each function it appears in.)
/usr/local/v3/include/bits/ios_base.h:152: warning: control reaches end of 
non-void function `_M_getloc()'
/usr/local/v3/include/bits/ios_base.h: At top level:
/usr/local/v3/include/bits/ios_base.h:160: warning: ANSI C++ forbids 
declaration `' with no type
/usr/local/v3/include/bits/ios_base.h:160: abstract declarator `int' used as 
declaration
/usr/local/v3/include/bits/ios_base.h:174: parse error before `protected'
/usr/local/v3/include/bits/ios_base.h:208: syntax error before `::'
/usr/local/v3/include/bits/ios_base.h:211: warning: ANSI C++ forbids 
declaration `' with no type
/usr/local/v3/include/bits/ios_base.h:211: abstract declarator `int' used as 
declaration
/usr/local/v3/include/bits/ios_base.h:211: `__prec' was not declared in this 
scope
/usr/local/v3/include/bits/ios_base.h:212: parse error before `return'
/usr/local/v3/include/bits/ios_base.h:216: syntax error before `::'
/usr/local/v3/include/bits/ios_base.h:219: warning: ANSI C++ forbids 
declaration `' with no type
/usr/local/v3/include/bits/ios_base.h:219: abstract declarator `int' used as 
declaration
/usr/local/v3/include/bits/ios_base.h:219: `__wide' was not declared in this 
scope
/usr/local/v3/include/bits/ios_base.h:220: parse error before `return'
/usr/local/v3/include/bits/ios_base.h:228: no `void *& ios_base::pword(int)' 
member function declared in class `ios_base'
/usr/local/v3/include/bits/ios_base.h:236: no `long int & 
ios_base::iword(int)' member function declared in class `ios_base'
/usr/local/v3/include/bits/ios_base.h:272: parse error before `}'
In file included from /usr/local/v3/include/bits/std_ios.h:41,
                 from /usr/local/v3/include/bits/std_fstream.h:23,
                 from /usr/local/v3/include/fstream:2,
                 from SCEN_Writer.cc:13:
/usr/local/v3/include/bits/locfacets.h:750: parse error before `,'
In file included from /usr/local/v3/include/bits/std_fstream.h:24,
                 from /usr/local/v3/include/fstream:2,
                 from SCEN_Writer.cc:13:
/usr/local/v3/include/bits/std_streambuf.h:80: type specifier omitted for 
parameter
/usr/local/v3/include/bits/std_streambuf.h:80: parse error before `)'
/usr/local/v3/include/bits/std_streambuf.h:96: syntax error before `('
/usr/local/v3/include/bits/std_streambuf.h:98: semicolon missing after 
declaration of `basic_streambuf<_CharT,_Traits>'
/usr/local/v3/include/bits/std_streambuf.h:98: parse error at null character
/usr/local/v3/include/bits/std_streambuf.h:98: parse error at null character
/usr/local/v3/include/bits/std_streambuf.h:109: syntax error before `('
/usr/local/v3/include/bits/std_streambuf.h:115: syntax error before `('
/usr/local/v3/include/bits/std_streambuf.h: In function `void stossc()':
/usr/local/v3/include/bits/std_streambuf.h:122: warning: implicit declaration 
of function `int _M_stossc(...)'
/usr/local/v3/include/bits/std_streambuf.h: In function `void _M_stossc()':
/usr/local/v3/include/bits/std_streambuf.h:126: `_IO_read_ptr' undeclared 
(first use this function)
/usr/local/v3/include/bits/std_streambuf.h:126: `_IO_read_end' undeclared 
(first use this function)
/usr/local/v3/include/bits/std_streambuf.h:126: confused by earlier errors, 
bailing out
% cat ../philspecs

*cc1plus:
-W -Wall -Woverloaded-virtual -Winline -Wundef -Wpointer-arith -Wconversion

% ^D
script done on Wed Oct 28 17:55:18 1998