Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. LNK2005 linking problem with libcmt.lib [modified]

LNK2005 linking problem with libcmt.lib [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionc++
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    theboywilse
    wrote on last edited by
    #1

    I'm currently trying to get our code to link using VS8 or 2005. We are currently using VS7 or 2003. When I link I get a collection of the following messages. LIBCMT.lib(printf.obj) : error LNK2005: _printf already defined in libredir.obw LIBCMT.lib(calloc.obj) : error LNK2005: _calloc already defined in liballoc.obw LIBCMT.lib(realloc.obj) : error LNK2005: _realloc already defined in liballoc.obw LIBCMT.lib(vprintf.obj) : error LNK2005: _vprintf already defined in libredir.obw After these errors obviously the linking fails. The code I am linking is a collection of C and C++ code producing DLLs and EXEs. Bits of the system were written in the very early days of windows. So there we have our own code to do malloc, calloc, printf, etc. What I understand after spending hours reading Microsoft and this site is that prior to VS8 we were linking using the single threaded library libc.lib. Now this is no more and thus we have to use the multi-threaded libcmt.lib. This is the cause of the bother. The questions Now we are being forced to use the multi-threaded library libcmt.lib how do I stop it complaining about our own defined functions and let our software compile? The answer isn't obviously to get rid of our versions because our huge code base uses these functions instead of microsoft and in the case of printf does something special to the output. One oddity is that we have defined our own malloc and it doesn't whinge about that. Any help would be gratefully received. steven -- modified at 13:00 Thursday 24th May, 2007

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups