Re: compilation errors

Discussion in 'C++' started by John Harrison, Jul 23, 2003.

  1. "seia0106" <> wrote in message
    news:...
    > 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::eek: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::eek:pen(char
    > const *,int,int)" (__imp_?open@ifstream@@QAEXPBDHH@Z)
    > ftxtstrm.obj : error LNK2001: unresolved external symbol
    > "__declspec(dllimport) public: static int const filebuf::eek: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
    John Harrison, Jul 23, 2003
    #1
    1. Advertising

  2. > Are you including a header file <iostream.h>? If so you should replace
    this
    > with
    >
    > #include <iostream> // note no .h
    > using namespace std;
    >


    I should say also replace

    #include <fstream.h>

    with

    #include <fstream> // note no .h
    using namespace std;

    and similarly for any other iostream type header files. You get the picture.

    john
    John Harrison, Jul 23, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eqbal

    compilation errors

    Eqbal, Nov 18, 2003, in forum: VHDL
    Replies:
    0
    Views:
    1,158
    Eqbal
    Nov 18, 2003
  2. Alfred B. Stansbury

    Newbie needs help with perl compilation errors

    Alfred B. Stansbury, Oct 21, 2004, in forum: Perl
    Replies:
    1
    Views:
    738
    Joe Smith
    Oct 22, 2004
  3. Mark Goldin

    Errors, errors, errors

    Mark Goldin, Jan 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    926
    Mark Goldin
    Jan 17, 2004
  4. Steve

    Dynamic compilation errors

    Steve, Oct 22, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    423
    Steve
    Oct 23, 2004
  5. C__chp
    Replies:
    4
    Views:
    493
    Puppet_Sock
    Feb 15, 2008
Loading...

Share This Page