J
Joe Greene
Compiling this file produces the "no appropriate default constructor available" error
shown below. Can anyone explain why I'm getting this error and how to fix it???
This source file has been reduced to the bare essentials to reproduce the error.
/* test.cpp */
#include <ostream>
class LogStream : public std:stream, public std::streambuf
{
public:
LogStream ();
};
LogStream :: LogStream ()
{
init(this);
};
/* end of test.cpp */
------ Build started: Project: test, Configuration: Debug Win32 ------
Compiling...
test.cpp
\Projects\test\test99\test.cpp(10) : error C2512: 'std::basic_ostream<_Elem,_Traits>' :
no appropriate default constructor available
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
Build log was saved at "file://d:\Projects\test\test99\test\Debug\BuildLog.htm"
test - 1 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
shown below. Can anyone explain why I'm getting this error and how to fix it???
This source file has been reduced to the bare essentials to reproduce the error.
/* test.cpp */
#include <ostream>
class LogStream : public std:stream, public std::streambuf
{
public:
LogStream ();
};
LogStream :: LogStream ()
{
init(this);
};
/* end of test.cpp */
------ Build started: Project: test, Configuration: Debug Win32 ------
Compiling...
test.cpp
\Projects\test\test99\test.cpp(10) : error C2512: 'std::basic_ostream<_Elem,_Traits>' :
no appropriate default constructor available
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
Build log was saved at "file://d:\Projects\test\test99\test\Debug\BuildLog.htm"
test - 1 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped