Mail Archives: djgpp/2002/12/31/06:30:09
Hello.
Y Chen wrote:
> I don't know why djgpp cannot compile the following sentences(the files are
> at the bottom):
>
> char cFilename[101];
> pFile->open(cFilename, aiMode);
[snip]
> IOBase.cpp: In member function `char TIOBase::OpenFile(std::fstream*, char*,
> int)':
> IOBase.cpp:123: no matching function for call to `std::basic_fstream<char,
> std::char_traits<char> >::open(char*&, int&)'
> d:/djgpp/lang/cxx-v3/bits/std_fstream.h:409: candidates are: void
> std::basic_fstream<_CharT, _Traits>::open(const char*, std::_Ios_Openmode =
> (std::ios_base::in | std::ios_base::out)) [with _CharT = char, _Traits =
> std::char_traits<char>]
[snip]
aiMode is the wrong type. It needs to be std::_Ios_Openmode rather than int, I
think.
It's worth trying to understand g++ error messages, even though it can be
tricky. g++ helps you out by suggested function calls that do match -
"candidates are:...".
HTH. Regards,
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -