Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fstream problems

0 views
Skip to first unread message

Someone

unread,
May 22, 2002, 10:10:36 AM5/22/02
to
I just upgraded to g++ version 3.1 from 3.0.1, and when i rebuild my apps, i
get a bunch of errors when i include <fstream>

In file included from /usr/local/include/g++-v3/fstream:48, from test.cpp:1:
/usr/local/include/g++-v3/bits/basic_file.h:52: parse error before `{' token
/usr/local/include/g++-v3/bits/basic_file.h:57: virtual outside class
declaration
/usr/local/include/g++-v3/bits/basic_file.h:57: function `int
std::overflow(int = -1)' is initialized like a variable
/usr/local/include/g++-v3/bits/basic_file.h:60: virtual outside class
declaration
/usr/local/include/g++-v3/bits/basic_file.h:60: function `int
std::underflow()' is initialized like a variable
/usr/local/include/g++-v3/bits/basic_file.h:63: virtual outside class
declaration
/usr/local/include/g++-v3/bits/basic_file.h:63: function `int std::uflow()'
is initialized like a variable
/usr/local/include/g++-v3/bits/basic_file.h:66: virtual outside class
declaration
/usr/local/include/g++-v3/bits/basic_file.h:66: function `int
std::pbackfail(int)' is initialized like a variable
/usr/local/include/g++-v3/bits/basic_file.h:69: parse error before `*' token
/usr/local/include/g++-v3/bits/basic_file.h:69: virtual outside class
declaration
/usr/local/include/g++-v3/bits/basic_file.h:69: function `streamsize
std::xsputn(...)' is initialized like a variable

Also, i tried creating a simple test program, and i get no output at all...

#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{
cout << "This is a test" << endl;
}

anything know what happened?!? I'm running solaris 2.8
$ g++ -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.1/specs
Configured with:
../configure --with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld --enabl
e-libgcj --enable-threads=posix --enable-long-long
Thread model: posix
gcc version 3.1


ellF

unread,
May 22, 2002, 6:30:47 PM5/22/02
to
I have the same trouble when trying to build programs on my local
linux machine using gc-3.1. Unimaginably frustrating - one of those
situations that "WTF" was designed for. :)

"Someone" <mike...@REMOVETHIShotmail.com> wrote in message news:<wFNG8.23164$cT2.2...@news-nb00s0.nbnet.nb.ca>...

Maurizio Loreti

unread,
May 23, 2002, 2:10:23 AM5/23/02
to
"Someone" <mike...@REMOVETHIShotmail.com> writes:

> I just upgraded to g++ version 3.1 from 3.0.1, and when i rebuild my apps, i
> get a bunch of errors when i include <fstream>

I have posted this same error to the gcc mailing list in the same say
that gcc 3.1 has been released. The answer (by Alexandre Oliva) came
half an hour later (can you obtain the same by a commercial service?)
and was:

> This file is not part of GCC 3.1. ... Could it possibly be a left
> over from an earlier install of GCC?

Of course, in the installation instructions I overlooked the lines
saying that the target tree should not contain a previous gcc
installation. I have rm -rf the whole {prefix}/include tree and
reinstalled, and all was OK since then

--
Maurizio Loreti http://www.pd.infn.it/~loreti/mlo.html
Dept. of Physics, Univ. of Padova, Italy loreti at pd dot infn dot it

Maurizio Loreti

unread,
May 23, 2002, 2:28:22 AM5/23/02
to
"Someone" <mike...@REMOVETHIShotmail.com> writes:

> I just upgraded to g++ version 3.1 from 3.0.1, and when i rebuild my apps, i
> get a bunch of errors when i include <fstream>

I have posted this same error to the gcc mailing list in the same day


that gcc 3.1 has been released. The answer (by Alexandre Oliva) came
half an hour later (can you obtain the same by a commercial service?)
and was:

> This file is not part of GCC 3.1. ... Could it possibly be a left
> over from an earlier install of GCC?

"file" was {prefix}/include/g++-v3/bits/basic_file.h (the same that
has caused your errors). Of course, in the installation instructions


I overlooked the lines saying that the target tree should not contain

a previous gcc installation. From the third line in
http://gcc.gnu.org/install/finalinstall.html :

"We strongly recommend to install into a target directory where there
is no previous version of GCC present."

I have rm -rf the whole {prefix}/include/g++-v3/ tree and reinstalled,
and all was OK since then.

Andrew J. P. Maclean

unread,
May 23, 2002, 7:39:55 PM5/23/02
to
Works perfectly for me.
You probably need to ensure that you include -L/usr/local/lib in any
commands to actually generate the final execuatable.
Or edit the specs file in the library to put the statement:
-L/usr/local/lib
in the *link: section

"Someone" <mike...@REMOVETHIShotmail.com> wrote in message
news:wFNG8.23164$cT2.2...@news-nb00s0.nbnet.nb.ca...

0 new messages