Visual C++ linker errors

Posted on 2003-02-25
Medium Priority
Last Modified: 2013-12-14
I have an application that is generating the following linker errors. Would anyone know how to resolve this?

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

Question by:Netstocker
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 86

Accepted Solution

jkr earned 1200 total points
ID: 8019824
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...

Author Comment

ID: 8021087
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. :)

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question