Article View: gnu.gcc.help
Article #42147fstream manipulation
From: R C Love (CoMIR)
Date: Mon, 15 Jan 1996 00:00
Date: Mon, 15 Jan 1996 00:00
45 lines
1372 bytes
1372 bytes
When trying to compile the following program...
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
#define LINELENGTH 4
int main(void)
{
ifstream file;
char buffer[LINELENGTH];
file.open( "test.input", ios::in );
while ( !file.eof() )
{
buffer[0] = '\0';
file >> setw(LINELENGTH) >> buffer;
cout << buffer << endl;
}
return 0;
}
I get the linking error...
/bin/../lib/ld:
Unresolved:
__rs__FR7istreamRCt6smanip1Zi
which is relating to the call to setw().
My compile line is simple (g++ test.cc) and the code works fine when using CC.
g++ -v reports version 2.6.3 and is running on Irix 5.3. The problem also
exists on earlier versions of g++.
Is this a known problem, or at least one that others have experienced,
or has our g++ been installed incorrectly?
Many thanks for your help
Rob Love
School of Computer Studies
University of Leeds, UK
Technical Details
Message-ID:
<1996Jan15.142631.6154@leeds.ac.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,b9c602f30559f45c,start X-Google-Attributes: gid11318c,public From: rcl@scs.leeds.ac.uk (R C Love (CoMIR)) Subject: fstream manipulation Date: 1996/01/15 Message-ID: <1996Jan15.142631.6154@leeds.ac.uk> X-Deja-AN: 135387388 newsgroups: gnu.gcc.help