none
Linker error LNK2005 and LNK2005 RRS feed

  • Question

  •  

    Hi;

      In my Visual C++ .NET Workspace around 11 projects are there. when i am making a function call which is defined in other project then i am getting following linker error.if i comment out that function call then i am not getting any error.

    error LNK2019: unresolved external symbol (Name of the Function) referenced in function _APP_Register

    then i added that function name in the def file of the project where i am making this function call. while building the project now i am getting 46 build errors including above one.

    i am getting following errror:

    syn.lib(xltdecxml.obj) : error LNK2005: _xltDecXmlInit already defined in xltdecxml.obj
    syn.lib(xltdecxml.obj) : error LNK2005: _isPcdata already defined in xltdecxml.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlStartMessage already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlEndMessage already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlStartSync already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlEndSync already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlStartAtomic already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlEndAtomic already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlStartSequence already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlEndSequence already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlAddCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlAlertCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlDeleteCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlGetCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlPutCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlMapCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlResultsCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlStatusCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlReplaceCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlCopyCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlExecCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlSearchCmd already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlStartEvaluation already defined in mgrcmdbuilder.obj
    syn.lib(mgrcmdbuilder.obj) : error LNK2005: _smlEndEvaluation already defined in mgrcmdbuilder.obj
    syn.lib(RegisterPlugIn.obj) : error LNK2005: _DL_DbInetGetRecordByIndex already defined in simulate.lib(simulate.dll)
    syn.lib(Util.obj) : error LNK2005: _Get_Mapping_RecordByIndex already defined in simulate.lib(simulate.dll)
    syn.lib(Util.obj) : error LNK2005: _Delete_Mapping_Record already defined in simulate.lib(simulate.dll)
    syn.lib(Util.obj) : error LNK2005: _Add_Mapping_Record already defined in simulate.lib(simulate.dll)
    syn.lib(Util.obj) : error LNK2005: _Create_Mapping_Table already defined in simulate.lib(simulate.dll)
    syn.lib(Util.obj) : error LNK2005: _Get_AppId_And_IndexId already defined in simulate.lib(simulate.dll)
    app_main.obj : error LNK2019: unresolved external symbol _TestlPlugin referenced in function _APP_Register
    syn.lib(xpl_Manager.obj) : error LNK2019: unresolved external symbol _InitFile referenced in function _XPL_Init
    syn.lib(xpl_Lib.obj) : error LNK2001: unresolved external symbol _wvimDataPluginNameTable
    syn.lib(xpl_Lib.obj) : error LNK2001: unresolved external symbol _NetworkStoreDataPluginNameTable
    syn.lib(xpl_Lib.obj) : error LNK2001: unresolved external symbol _fumoExecPluginNameTable
    syn.lib(xpl_Lib.obj) : error LNK2001: unresolved external symbol _fumoDataPluginNameTable
    syn.lib(DevDetailDataPlugin.obj) : error LNK2019: unresolved external symbol "void __cdecl DL_SigRegQueryNetwork(struct DL_SIG_REG_NETWORK_T *)" (?DL_SigRegQueryNetwork@@YAXPAUDL_SIG_REG_NETWORK_T@@@Z) referenced in function "public: virtual unsigned int __thiscall DmtDevDetailDataPluginNode::GetValue(class DmtData &)const " (?GetValue@DmtDevDetailDataPluginNode@@UBEIAAVDmtData@@@Z)
    syn.lib(Connection_impl.obj) : error LNK2019: unresolved external symbol __imp__InternetReadFile@16 referenced in function "unsigned long __stdcall SendHttpRequestThread(void *)" (?SendHttpRequestThread@@YGKPAX@Z)
    syn.lib(dmConnection_impl.obj) : error LNK2019: unresolved external symbol __imp__HttpQueryInfoA@20 referenced in function "unsigned long __stdcall SendHttpRequestThread(void *)" (?SendHttpRequestThread@@YGKPAX@Z)
    syn.lib(dmConnection_impl.obj) : error LNK2019: unresolved external symbol __imp__HttpSendRequestA@20 referenced in function "unsigned long __stdcall SendHttpRequestThread(void *)" (?SendHttpRequestThread@@YGKPAX@Z)
    syn.lib(dmConnection_impl.obj) : error LNK2019: unresolved external symbol __imp__HttpOpenRequestA@32 referenced in function "unsigned long __stdcall SendHttpRequestThread(void *)" (?SendHttpRequestThread@@YGKPAX@Z)
    syn.lib(dmConnection_impl.obj) : error LNK2019: unresolved external symbol __imp__InternetCloseHandle@4 referenced in function "unsigned long __stdcall SendHttpRequestThread(void *)" (?SendHttpRequestThread@@YGKPAX@Z)
    syn.lib(dmConnection_impl.obj) : error LNK2019: unresolved external symbol __imp__InternetConnectA@32 referenced in function "unsigned long __stdcall SendHttpRequestThread(void *)" (?SendHttpRequestThread@@YGKPAX@Z)
    syn.lib(dmConnection_impl.obj) : error LNK2019: unresolved external symbol __imp__InternetOpenA@20 referenced in function "unsigned long __stdcall SendHttpRequestThread(void *)" (?SendHttpRequestThread@@YGKPAX@Z)

    can anybody help me.

    Thanks in Advance

    Thursday, April 20, 2006 5:51 AM

Answers

  • Seams that you have 2 libraries included that conatin the same symbols.

    Use the linker /VERBOSE option and see what libraries are used.

    Thursday, April 20, 2006 9:24 AM
    Moderator

All replies

  • Seams that you have 2 libraries included that conatin the same symbols.

    Use the linker /VERBOSE option and see what libraries are used.

    Thursday, April 20, 2006 9:24 AM
    Moderator
  • Hi Richter;

       Thanks for your thought. yes you are right, actually in two project same file are used, can you tell me how to resolve this issue without deleteing or modifying those file.the problem is that i need to use both libraries together in my project but its conflicting.

    Looking forward for any help.

    Thursday, April 20, 2006 10:46 AM
  • It is not a problem to use one lib in 2 projects. Its a problem to use 2 libs with the same obkect file in one project. This must be fixed. Maybe its enough to declare one project (that produces the libs) as dependency form the main project and not to define this lib in the linker options too.
    Sunday, April 23, 2006 4:11 PM
    Moderator