473,692 Members | 2,533 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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::st r ()'

Here is the mentioned line from the h_utl.cpp:

istrstream &operator>>(ist rstream &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(streamo ff, _seek_dir, int mode=ios::in|io s::out);
};

class istrstream : public strstreambase, public istream {
public:
istrstream(cons t 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 3144
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::st r ()'
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>>(ist rstream &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(streamo ff, _seek_dir, int mode=ios::in|io s::out);
};

class istrstream : public strstreambase, public istream {
public:
istrstream(cons t 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
2441
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 find an explanation for is why str.join() doesn't automatically call str() on its arguments, so that e.g. str.join() would yield "1245", and ditto for e.g. user-defined classes that have a __str__() defined. All I've been able to find is a 1999...
6
8140
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 function?
6
3887
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 OpenSSL's sha1() to convert the string to a SHA-1 160-bit message digest. The question is: how do I use these 160 bits to get my final 32 bits? Should I use the first 32 bits or the last 32 bits or is there yet another method? Note: I understand...
0
8546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9090
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8969
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8810
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6462
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5822
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2981
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1962
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.