J
Julian
I have this piece of code that is working fine in VC6... but when i tried to
compile the same code in VC++.NET, I am getting this error :
error C2512: 'std::basic_ostream<_Elem,_Traits>' : no appropriate default
constructor available
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
i had also changed #include <fstream.h> to #include <fstream>
and added this line "using namespace std;"
following is the relevant code : the arrow shows the line at which the error
is being generated
i understand that the libraries might have changed during the upgrade from
6.0 0 7.0. can you tell me what is the appropriate method to fix the code
again?
i would also appreciate if you can tell me about any sites that let you how
to fix these kind of errors that come from 6.0 - > 7.0
thanks,
Julian.
#include <fstream>
using namespace std;
class ArgumentOstream : public ostream
{
private:
ofstream *ostrm;
bool streamOwner;
public:
ArgumentOstream(Arguments &args, ostream &o=cout) <------------------
{
....
}
init(o.rdbuf());
}
~ArgumentOstream() {if(streamOwner) ostrm->close();}
};
compile the same code in VC++.NET, I am getting this error :
error C2512: 'std::basic_ostream<_Elem,_Traits>' : no appropriate default
constructor available
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
i had also changed #include <fstream.h> to #include <fstream>
and added this line "using namespace std;"
following is the relevant code : the arrow shows the line at which the error
is being generated
i understand that the libraries might have changed during the upgrade from
6.0 0 7.0. can you tell me what is the appropriate method to fix the code
again?
i would also appreciate if you can tell me about any sites that let you how
to fix these kind of errors that come from 6.0 - > 7.0
thanks,
Julian.
#include <fstream>
using namespace std;
class ArgumentOstream : public ostream
{
private:
ofstream *ostrm;
bool streamOwner;
public:
ArgumentOstream(Arguments &args, ostream &o=cout) <------------------
{
....
}
init(o.rdbuf());
}
~ArgumentOstream() {if(streamOwner) ostrm->close();}
};