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. Getting the error LNK2005 how to resolve this.I tried to set the properties but still i am finding the error at link

Getting the error LNK2005 how to resolve this.I tried to set the properties but still i am finding the error at link

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 Posts 3 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.
  • P Offline
    P Offline
    pallaka
    wrote on last edited by
    #1

    Hi I am getting the error show below.This is the linker error and i am not able to resolve it.I am afraid that I am giving improper selection in the Properties. Kindly help me out. 1>AltABFUtil.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification 1>msvcprt.lib(MSVCP80.dll) : error LNK2005: "class std::basic_string<char,struct>,class std::allocator > __cdecl std::operator+<char,struct>,class std::allocator >(class std::basic_string<char,struct>,class std::allocator > const &,class std::basic_string<char,struct>,class std::allocator > const &)" (??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@0@Z) already defined in abflib.obj 1>msvcprt.lib(MSVCP80.dll) : error LNK2005: "class std::basic_string<char,struct>,class std::allocator > __cdecl std::operator+<char,struct>,class std::allocator >(class std::basic_string<char,struct>,class std::allocator > const &,char const *)" (??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@PBD@Z) already defined in abflib.obj 1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library

    S M 2 Replies Last reply
    0
    • P pallaka

      Hi I am getting the error show below.This is the linker error and i am not able to resolve it.I am afraid that I am giving improper selection in the Properties. Kindly help me out. 1>AltABFUtil.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification 1>msvcprt.lib(MSVCP80.dll) : error LNK2005: "class std::basic_string<char,struct>,class std::allocator > __cdecl std::operator+<char,struct>,class std::allocator >(class std::basic_string<char,struct>,class std::allocator > const &,class std::basic_string<char,struct>,class std::allocator > const &)" (??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@0@Z) already defined in abflib.obj 1>msvcprt.lib(MSVCP80.dll) : error LNK2005: "class std::basic_string<char,struct>,class std::allocator > __cdecl std::operator+<char,struct>,class std::allocator >(class std::basic_string<char,struct>,class std::allocator > const &,char const *)" (??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@PBD@Z) already defined in abflib.obj 1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      You are trying to link with two different versions of the C runtime library (MSVCRT). This usually occurs because you are linking with object code or a static library that was compiled against a different variant of the CRT. Make sure that all of your code uses the same run-time library option (it's in the C/C++ compiler properties, in the Code Generation page).

      1 Reply Last reply
      0
      • P pallaka

        Hi I am getting the error show below.This is the linker error and i am not able to resolve it.I am afraid that I am giving improper selection in the Properties. Kindly help me out. 1>AltABFUtil.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification 1>msvcprt.lib(MSVCP80.dll) : error LNK2005: "class std::basic_string<char,struct>,class std::allocator > __cdecl std::operator+<char,struct>,class std::allocator >(class std::basic_string<char,struct>,class std::allocator > const &,class std::basic_string<char,struct>,class std::allocator > const &)" (??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@0@Z) already defined in abflib.obj 1>msvcprt.lib(MSVCP80.dll) : error LNK2005: "class std::basic_string<char,struct>,class std::allocator > __cdecl std::operator+<char,struct>,class std::allocator >(class std::basic_string<char,struct>,class std::allocator > const &,char const *)" (??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@PBD@Z) already defined in abflib.obj 1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library

        M Offline
        M Offline
        Malli_S
        wrote on last edited by
        #3

        It seems that you are using STL. The possibility is that the variable you are using in the AtlABFUtil.cpp is already been defined in abflib.cpp. Have you included abflib.cpp into atlABFUtil.cpp ? Can you post code snippet for more details ?

        [Delegates]      [Virtual Desktop]      [Tray Me !]

        -Malli...! :rose:****

        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