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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. dll linkage madness

dll linkage madness

Scheduled Pinned Locked Moved C / C++ / MFC
helpcomquestion
6 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.
  • B Offline
    B Offline
    bryce
    wrote on last edited by
    #1

    Hello i have been asked to look at a dll "issue" and i cant see why its acting up. However, when the dll builds the linker throws a headcase and spews out a bunch of errors ClientState.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj DisplayControl.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj EquipmentID.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj FaultData.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj MSCIntraInterface.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj MsgQueue.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj TcpListener.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj Sort of thing The RPD_APP_EXT is defined in "globaldefines.h" which uses #ifndef GlobalDefines_h #define GlobalDefines_h const char * RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"}; etc etc #endif And as well as that the header files for every class all correctly use #ifndef < sometag > #define < some tag > . (.class definitions etc) #endif also,The compiler settings are set with the multithreaded /md option I was wondering if anyone had any suggestions as to what one might do to fix this issue? regards Bryce --- Publitor, making Pubmed easy. http://www.sohocode.com/publitor

    T R PJ ArendsP B 4 Replies Last reply
    0
    • B bryce

      Hello i have been asked to look at a dll "issue" and i cant see why its acting up. However, when the dll builds the linker throws a headcase and spews out a bunch of errors ClientState.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj DisplayControl.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj EquipmentID.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj FaultData.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj MSCIntraInterface.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj MsgQueue.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj TcpListener.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj Sort of thing The RPD_APP_EXT is defined in "globaldefines.h" which uses #ifndef GlobalDefines_h #define GlobalDefines_h const char * RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"}; etc etc #endif And as well as that the header files for every class all correctly use #ifndef < sometag > #define < some tag > . (.class definitions etc) #endif also,The compiler settings are set with the multithreaded /md option I was wondering if anyone had any suggestions as to what one might do to fix this issue? regards Bryce --- Publitor, making Pubmed easy. http://www.sohocode.com/publitor

      T Offline
      T Offline
      twing
      wrote on last edited by
      #2

      Maybe char* const RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"}; Hello World!

      B 1 Reply Last reply
      0
      • T twing

        Maybe char* const RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"}; Hello World!

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

        yep did that didnt help (much) ;) Bryce --- Publitor, making Pubmed easy. http://www.sohocode.com/publitor

        1 Reply Last reply
        0
        • B bryce

          Hello i have been asked to look at a dll "issue" and i cant see why its acting up. However, when the dll builds the linker throws a headcase and spews out a bunch of errors ClientState.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj DisplayControl.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj EquipmentID.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj FaultData.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj MSCIntraInterface.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj MsgQueue.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj TcpListener.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj Sort of thing The RPD_APP_EXT is defined in "globaldefines.h" which uses #ifndef GlobalDefines_h #define GlobalDefines_h const char * RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"}; etc etc #endif And as well as that the header files for every class all correctly use #ifndef < sometag > #define < some tag > . (.class definitions etc) #endif also,The compiler settings are set with the multithreaded /md option I was wondering if anyone had any suggestions as to what one might do to fix this issue? regards Bryce --- Publitor, making Pubmed easy. http://www.sohocode.com/publitor

          R Offline
          R Offline
          rpins
          wrote on last edited by
          #4

          Try this...in globaldefines.h, say #ifndef GlobalDefines_h #define GlobalDefines_h ...other code... extern const char* RPD_APP_FILE_EXT[]; ...other code... #endif And then in some other .cpp file (perhaps globaldefines.cpp), do the actual definition of RPD_APP_FILE_EXT, i.e. in the cpp file: #include "globaldefines.h" const char* RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"}; ...other code... Even if you have include-guards on your headers, if they're included in multiple places and have variable definitions (not just declarations), then you'll usually get those link errors. HTH

          1 Reply Last reply
          0
          • B bryce

            Hello i have been asked to look at a dll "issue" and i cant see why its acting up. However, when the dll builds the linker throws a headcase and spews out a bunch of errors ClientState.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj DisplayControl.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj EquipmentID.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj FaultData.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj MSCIntraInterface.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj MsgQueue.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj TcpListener.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj Sort of thing The RPD_APP_EXT is defined in "globaldefines.h" which uses #ifndef GlobalDefines_h #define GlobalDefines_h const char * RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"}; etc etc #endif And as well as that the header files for every class all correctly use #ifndef < sometag > #define < some tag > . (.class definitions etc) #endif also,The compiler settings are set with the multithreaded /md option I was wondering if anyone had any suggestions as to what one might do to fix this issue? regards Bryce --- Publitor, making Pubmed easy. http://www.sohocode.com/publitor

            PJ ArendsP Offline
            PJ ArendsP Offline
            PJ Arends
            wrote on last edited by
            #5

            maybe because you can not initialize variables in header files?


            [

            ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

            Within you lies the power for good; Use it!

            1 Reply Last reply
            0
            • B bryce

              Hello i have been asked to look at a dll "issue" and i cant see why its acting up. However, when the dll builds the linker throws a headcase and spews out a bunch of errors ClientState.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj DisplayControl.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj EquipmentID.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj FaultData.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj MSCIntraInterface.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj MsgQueue.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj TcpListener.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj Sort of thing The RPD_APP_EXT is defined in "globaldefines.h" which uses #ifndef GlobalDefines_h #define GlobalDefines_h const char * RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"}; etc etc #endif And as well as that the header files for every class all correctly use #ifndef < sometag > #define < some tag > . (.class definitions etc) #endif also,The compiler settings are set with the multithreaded /md option I was wondering if anyone had any suggestions as to what one might do to fix this issue? regards Bryce --- Publitor, making Pubmed easy. http://www.sohocode.com/publitor

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

              all fixed now, turns out one of the developers had been messing with the project settings cheers all bryce --- Publitor, making Pubmed easy. http://www.sohocode.com/publitor

              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