 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Koutsi Guest
|
Posted: Fri Sep 19, 2003 10:25 am Post subject: Using STLPort compiling problems |
|
|
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
|
Posted: Fri Sep 19, 2003 11:17 am Post subject: Re: Using STLPort compiling problems |
|
|
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 |
|
 |
|
|
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
|
|