• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1886
  • Last Modified:

Visual C++ linker errors

I have an application that is generating the following linker errors. Would anyone know how to resolve this?

Linking...
msvcirt.lib(MSVCIRT.dll) : error LNK2005: "public: __thiscall ofstream::ofstream(void)" (??0ofstream@@QAE@XZ) already defined in libci.lib(ofstream.obj)
msvcirt.lib(MSVCIRT.dll) : error LNK2005: "public: virtual __thiscall ios::~ios(void)" (??1ios@@UAE@XZ) already defined in libci.lib(_ios.obj)
msvcirt.lib(MSVCIRT.dll) : error LNK2005: "public: virtual __thiscall ofstream::~ofstream(void)" (??1ofstream@@UAE@XZ) already defined in libci.lib(ofstream.obj)
msvcirt.lib(MSVCIRT.dll) : error LNK2005: "public: void __thiscall ofstream::close(void)" (?close@ofstream@@QAEXXZ) already defined in libci.lib(ofstream.obj)
msvcirt.lib(MSVCIRT.dll) : error LNK2005: "public: void __thiscall ofstream::open(char const *,int,int)" (?open@ofstream@@QAEXPBDHH@Z) already defined in libci.lib(ofstream.obj)
libci.lib(filebuf.obj) : error LNK2001: unresolved external symbol ___pioinfo


Thanks,
Netstocker
0
Netstocker
Asked:
Netstocker
1 Solution
 
jkrCommented:
LIBCI.LIB is Single threaded, static link, MSVCIRT.LIB is Multithreaded, dynamic link - you cannot use both of them. Remove the one that does not match to your project type. BTW, these libs refer to the Old Iostream Libraries and are both for legacy support only...
0
 
NetstockerAuthor Commented:
I spent sometime change the build configurations around and recompiling some of the external libraries use MFC as shared DLLs. I don't know if this somehow bypassed the legacy C runtime libraries. Anyhow, I'm just glad that my application compiled without errors. :)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now