Mail Archives: djgpp/2003/02/14/17:45:40
"Y Chen" <yc12 AT uow DOT edu DOT au> escribió en el mensaje
news:200302140432 DOT h1E4WcuJ018929 AT chac DOT its DOT uow DOT edu DOT au...
> Dear Sir,
>
> I've changed
> char TIOBase::OpenFile(char* acFilename, int aiMode)
> to
> char TIOBase::OpenFile(char* acFilename, std::_Ios_Openmode aiMode)
> to avoid the error:
> IOBase.cpp:45: no matching function for call to
`std::basic_fstream<char,
> std::char_traits<char> >::open(char[101], int&)'
>
>
>
> But the following sentence:
> if (OpenFile(cParFilename, ios::in)) return 1;
>
> gives the following error during link:
>
> LSTM2.o(.text+0x11f6):LSTM2.cpp: more undefined references to
`TIOBase::OpenFile
> (char*, int)' follow
>
> How to modify ios::in to get rid of the link error?
> Thanks a lot for your help.
>
> Regards,
> Y Chen
>
[snip code]
Are you kidding? Your code it's a horrible mess of C and C++, and you have a
strange mix of old and new header files.
In another thread, I ask for the version of GCC/DJGPP and the name of book
or tutorial that you're using. Because the first #include in your source is
#include <iostream>
my guess it's that GCC > 3.0 (or that you misunderstood previous advices).
Can you explain me why do you use the old (deprecated) form for the headers
iomanip and string?
Many times, you're advised for the RIGHT WAY include headers in C++, and,
most importantly, that you provide a *short* piece of compilable code. Did
you expect that we follow hundreds of lines of code?
Seriously, you need a better tutorial/book. I recommend _Thinking in C++,
2nd Edition, by Bruce Eckel. You can download at
http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html
OTOH, after your code was edited (according Standard), its compilable, but
you forgot list the LSTM2.cpp file :(
HTH
J. L.
- Raw text -