"seia0106" <> wrote in message
news: om...
> while writing an application with MS-DirctX9, i had following
> compilaiton errors. Despite much effort i could not get rid of these
> error messages. Would someone please help me and tell me about the
> cause of these error messages and how to correct them. thanks
>
> ************************************************** ********************
> Creating library Debug_Unicode/ball.lib and object
> Debug_Unicode/ball.exp
> ftxtstrm.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: __thiscall ifstream::ifstream(void)"
> (__imp_??0ifstream@@QAE@XZ)
> ftxtstrm.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: void __thiscall ifstream::`vbase
> destructor'(void)" (__imp_??_Difstream@@QAEXXZ)
> ftxtstrm.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: __thiscall ios:
perator void
> *(void)const " (__imp_??Bios@@QBEPAXXZ)
> ftxtstrm.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: class istream & __thiscall
> istream::getline(unsigned char *,int,char)"
> (__imp_?getline@istream@@QAEAAV1@PAEHD@Z)
> ftxtstrm.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: void __thiscall ifstream:
pen(char
> const *,int,int)" (__imp_?open@ifstream@@QAEXPBDHH@Z)
> ftxtstrm.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static int const filebuf:
penprot"
> (__imp_?openprot@filebuf@@2HB)
> ftxtstrm.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: void __thiscall ifstream::close(void)"
> (__imp_?close@ifstream@@QAEXXZ)
> .\Debug_Unicode\ball.ax : fatal error LNK1120: 7 unresolved externals
> Error executing link.exe.
They aren't compiler errors, they are linker errors. The cause of these
errors is that you haven't linked with the correct library, in other words
your project settings are wrong. To me it looks like you are using
Microsoft's obsolete iostream library, and trying to import it from a DLL.
Are you including a header file <iostream.h>? If so you should replace this
with
#include <iostream> // note no .h
using namespace std;
That will get you the modern iostream library. If that doesn't help then ask
on a VC++ newsgroup (for instance news:microsoft.public.vc.language) linker
errors are compiler specific and so are off topic in a language group, like
comp.lang.c++.
john