hindi

I am trying to compile a softhphone using visual studio C++ 2005. I first got this error:

LINK : fatal error LNK1104: cannot open file 'libc.lib'"

After that, i tried to ignore the libc.lib libray, then i got the following errors:

LIBCMTD.lib(_file.obj) : error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR80.dll)

LIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in MSVCRT.lib(MSVCR80.dll)

LIBCMTD.lib(dbgheap.obj) : error LNK2005: _calloc already defined in MSVCRT.lib(MSVCR80.dll)

Can someone help me in this problem




Re: Visual C++ General LINK : fatal error LNK1104: cannot open file 'libc.lib'

SeeSharp

It's probably because you were building with the wrong runtime library. Check your project property page, look for Runtime Library setting. Trying using /MD or other flag and build again. You don't need to ignore any library.

SeeSharp





Re: Visual C++ General LINK : fatal error LNK1104: cannot open file 'libc.lib'

hindi

I tried all the flags before ignoring the libc.lib library, but the same errors would occur. Is there anything else I can do






Re: Visual C++ General LINK : fatal error LNK1104: cannot open file 'libc.lib'

SeeSharp

You may try to do some search on "C runtime library" or "libc.lib". Below is a link might be useful.

http://support.microsoft.com/kb/154753





Re: Visual C++ General LINK : fatal error LNK1104: cannot open file 'libc.lib'

Simple Samples

What errors do you get if you do not ignore the libc.lib libray

It is probable that you do have an incompatible mix of runtime libraries. Look at all components in the project in case one of them has something different from the other components. Also, if you link with a library that is not a default library then that might be causing the problem.






Re: Visual C++ General LINK : fatal error LNK1104: cannot open file 'libc.lib'

Bite Qiu - MSFT

hindi wrote:

I am trying to compile a softhphone using visual studio C++ 2005. I first got this error:

LINK : fatal error LNK1104: cannot open file 'libc.lib'"

After that, i tried to ignore the libc.lib libray, then i got the following errors:

LIBCMTD.lib(_file.obj) : error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR80.dll)

LIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in MSVCRT.lib(MSVCR80.dll)

LIBCMTD.lib(dbgheap.obj) : error LNK2005: _calloc already defined in MSVCRT.lib(MSVCR80.dll)

Can someone help me in this problem

Hi Hindi,

A few comments:

1. libc.lib is a old single-threaded static link CRT library, which is not supported since visual c++ 2005 and greater, it should not be used anymore.

2. For those LNK2005 errors, does your project linking to some other libraries If yes, then most likely that these libraries link with libc.lib or other statically linked CRT libraries, which cause redefinitions because your project is linking with a different(newer) version of CRT library. In this case, if you own these libraries, rebuild them in VC2005, if not, ask the library publisher to send a new version of their library which is build with VC2005.

3. If all above does not help, change project settings "Show Progress" to "Display some progress messages" in the General property page of the Linker folder in a project's Property Pages dialog box, rebuild your project and show us the result in output window.

hope it helps

rico