473,324 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

g++296: no matching function for call to istrstream::str()

Hi,

I'm trying to port a bigger program from Visual C++
to Linux and after rewriting few Visual C++ functions
(strnicmp, filelength, findnext, etc.) I'm finally
down to just one (!) error message and now I'm stuck :-(

Does anybody please know, what could this error mean:

h_utl.cpp: In function `istrstream &operator>> (istrstream &, TVersion &)':
h_utl.cpp:108: no matching function for call to `istrstream::str ()'

Here is the mentioned line from the h_utl.cpp:

istrstream &operator>>(istrstream &is, TVersion &aVersion)
{
char *str=is.str();

When I look into the header /usr/include/g++3/strstream.h
(yes, I have to use g++296, the newer gcc does not work)
there is an str() function in the friend class:

class strstreambuf : public streambuf
{
struct _IO_str_fields _s;
friend class istrstream;
.....
public:
.....
char *str();
virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
};

class istrstream : public strstreambase, public istream {
public:
istrstream(const char*, int=0);
};

But how to call it? Do I need some switch for g++296?
Please help the C++ idiot. And no, I can not rewrite that program.

Regards && merry Xmas
Alex
Jul 22 '05 #1
1 3110
A. Farber wrote:
I'm trying to port a bigger program from Visual C++
to Linux and after rewriting few Visual C++ functions
(strnicmp, filelength, findnext, etc.) I'm finally
down to just one (!) error message and now I'm stuck :-(

Does anybody please know, what could this error mean:

h_utl.cpp: In function `istrstream &operator>> (istrstream &, TVersion &)':
h_utl.cpp:108: no matching function for call to `istrstream::str ()'
It can only mean one thing: your 'istrstream' implementation does not have
the 'str' function, which is very strange.

Here is the mentioned line from the h_utl.cpp:

istrstream &operator>>(istrstream &is, TVersion &aVersion)
{
char *str=is.str();

When I look into the header /usr/include/g++3/strstream.h
(yes, I have to use g++296, the newer gcc does not work)
What do you mean "does not work"? Thousands of people use "the newer gcc"
and are happy about the improvements...
there is an str() function in the friend class:

class strstreambuf : public streambuf
{
struct _IO_str_fields _s;
friend class istrstream;
.....
public:
.....
char *str();
virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
};

class istrstream : public strstreambase, public istream {
public:
istrstream(const char*, int=0);
};

But how to call it? Do I need some switch for g++296?
We know nothing about switches. Try gnu.g++.help.
Please help the C++ idiot. And no, I can not rewrite that program.


How can we help you if you cannot rewrite the program?

You could try to call the 'str' function of the stream buffer:

char *str = is.rdbuf()->str();

but in your version I cannot be sure what's happening since you're using
a deprecated version of string-based streams and a buggy compiler.

Victor
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: Leo Breebaart | last post by:
I've tried Googling for this, but practically all discussions on str.join() focus on the yuck-ugly-shouldn't-it-be-a-list-method? issue, which is not my problem/question at all. What I can't...
6
by: barcaroller | last post by:
I'm looking for a hash function (in C) that will convert a string of arbitrary length (but less than 1024 chars) to a reasonably-unique 16-bit short integer. Can anyone point me to such a hash...
6
by: barcaroller | last post by:
I couldn't find a message-digest newsgroup, so I posted here. I have a C function that converts a string of arbitrary length to a 32-bit hash value. I realize this is overkill but I used...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.