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. Error Link in VC++

Error Link in VC++

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
5 Posts 4 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
    TrungHuynh
    wrote on last edited by
    #1

    Hello I create a MFC aplication, and in my cpp file, i define a variable C++ string str; I know that, i can use CString, but i want to know why it appears "error link" when i compile project, it appears error (error link) like that "Linking... msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (??1?$basic_strin g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in ocl.lib(ora.obj) msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class basic_string,class std::allocator >::allocator const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) already defined in ocl.lib(ora.obj) LINK : warning LNK4098: defaultlib "LIBCMTD" conflicts with use of other libs; use /NODEFAULTLIB:library Bin/BMSOracleView.exe : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. "

    B R 2 Replies Last reply
    0
    • T TrungHuynh

      Hello I create a MFC aplication, and in my cpp file, i define a variable C++ string str; I know that, i can use CString, but i want to know why it appears "error link" when i compile project, it appears error (error link) like that "Linking... msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (??1?$basic_strin g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in ocl.lib(ora.obj) msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class basic_string,class std::allocator >::allocator const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) already defined in ocl.lib(ora.obj) LINK : warning LNK4098: defaultlib "LIBCMTD" conflicts with use of other libs; use /NODEFAULTLIB:library Bin/BMSOracleView.exe : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. "

      B Offline
      B Offline
      bryce
      wrote on last edited by
      #2

      coz "string" is STL string or std::string Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
      Publitor, making Pubmed easy. http://www.sohocode.com/publitor

      Our kids book :The Snot Goblin

      1 Reply Last reply
      0
      • T TrungHuynh

        Hello I create a MFC aplication, and in my cpp file, i define a variable C++ string str; I know that, i can use CString, but i want to know why it appears "error link" when i compile project, it appears error (error link) like that "Linking... msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (??1?$basic_strin g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in ocl.lib(ora.obj) msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class basic_string,class std::allocator >::allocator const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) already defined in ocl.lib(ora.obj) LINK : warning LNK4098: defaultlib "LIBCMTD" conflicts with use of other libs; use /NODEFAULTLIB:library Bin/BMSOracleView.exe : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. "

        R Offline
        R Offline
        Robert A T Kaldy
        wrote on last edited by
        #3

        The ocl.lib is your or third-party library? Robert-Antonio "Friends come and leave, but teddybears stay in forever."

        D 1 Reply Last reply
        0
        • R Robert A T Kaldy

          The ocl.lib is your or third-party library? Robert-Antonio "Friends come and leave, but teddybears stay in forever."

          D Offline
          D Offline
          dharani
          wrote on last edited by
          #4

          try inclding the lines at ur stdafx.h using namespace std; replace string with std::string and I hope u have not forgotten to include #include Dharani babu S redindian

          R 1 Reply Last reply
          0
          • D dharani

            try inclding the lines at ur stdafx.h using namespace std; replace string with std::string and I hope u have not forgotten to include #include Dharani babu S redindian

            R Offline
            R Offline
            Robert A T Kaldy
            wrote on last edited by
            #5

            I think that it isn't the case. If you forget the std namespace, you will get an Undeclared identifier error, not linker error. Robert-Antonio "What do you mean, I can't initialize things in an assert()?"

            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