C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using STLPort compiling problems

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
Koutsi
Guest





PostPosted: Fri Sep 19, 2003 10:25 am    Post subject: Using STLPort compiling problems Reply with quote



I am trying to compile a program but i get the following error.

D:koutsiogre-v0.11.0ogrenewTOOLSVRML2Meshvrmllibsrccommentstream.cpp(47)
: error C2512: 'basic_istream<char,struct std::char_traits' :
no appropriate default constructor available
D:koutsiogre-v0.11.0ogrenewTOOLSVRML2Meshvrmllibsrccommentstream.cpp(47)
: error C2614: 'commentstream' : illegal member initialization:
'istream' is not a base or member

The code that produces the error is:
commentstream::commentstream(std::istream &s, char start, char end)
:std::istream( new commentstreambuf(s.rdbuf(), start, end) )
{
}

Can someone help me on that?
I installed STLPort with iostreams implementation. Should i have
installed without iostreams implementation?

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Ulrich Eckhardt
Guest





PostPosted: Fri Sep 19, 2003 11:17 am    Post subject: Re: Using STLPort compiling problems Reply with quote



Koutsi wrote:
Quote:
commentstream.cpp(47): error C2512 :
'basic_istream<char,struct std::char_traits' :
no appropriate default constructor available

commentstream.cpp(47): error C2614:
'commentstream' : illegal member initialization:
'istream' is not a base or member

The code that produces the error is:
commentstream::commentstream(std::istream &s, char start, char end)
:std::istream( new commentstreambuf(s.rdbuf(), start, end) )
{
}

Those error-messages do not match the code, with STLport I would expect some
_STL:: qualifiers. If you installed STLport so that the whole namespace std
gets into the global namespace, set me tell you that this is fubar.
Else, I don't think the error is in the shown code but the parts you don't
show. Also try the code with the native stdlib or a different compiler in
order to rule out that the foult is anyhow connected to STLport.

Make sure that this compiles:

#include <istream>

void foo()
{
std::istream i(0);
}

Uli


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.