Thread: [OpenSIPStack] Linking errors
Brought to you by:
joegenbaclor
From: OpenSIPStack F. <ope...@op...> - 2008-11-05 14:58:41
|
Hi there, I am using the OpenSipStack library in my VCProject. I complied the library in release configuration. But as I start compilation of my project in release configuration it gives me following linking errors: 1>libcmtd.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSVCR80.dll) 1>libcmtd.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRT.lib(MSVCR80.dll) 1>libcmtd.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR80.dll) 1>libcmtd.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR80.dll) 1>libcmtd.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter already defined in MSVCRT.lib(MSVCR80.dll) 1>libcmtd.lib(dbgheap.obj) : error LNK2005: _malloc already defined in MSVCRT.lib(MSVCR80.dll) 1>libcmtd.lib(dbgheap.obj) : error LNK2005: _calloc already defined in MSVCRT.lib(MSVCR80.dll) 1>libcmtd.lib(dbgheap.obj) : error LNK2005: _realloc already defined in MSVCRT.lib(MSVCR80.dll) 1>libcmtd.lib(dbgheap.obj) : error LNK2005: _free already defined in MSVCRT.lib(MSVCR80.dll) Through this is working fine if I do compliation in debug configuration of both library and project. Can anybody have some clues on this? Thanks in advance. Regards, Jaydeep |
From: <jo...@op...> - 2008-11-05 15:10:07
|
Try linking to the C++ runtime dynamically. From the looks of it, you are trying to use Multi-threaded static linking. Try using Multi-threaded DLL instead in your code generation. If you still encounter problems after, please send your linker command line. You can also compare your linker command line to the OpenSBC linker command line and see what you did differently. Joegen OpenSIPStack Forum wrote: > Hi there, > > > I am using the OpenSipStack library in my VCProject. I complied the library in release configuration. But as I start compilation of my project in release configuration it gives me following linking errors: > > > 1>libcmtd.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSVCR80.dll) > > > 1>libcmtd.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRT.lib(MSVCR80.dll) > > > 1>libcmtd.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR80.dll) > > > 1>libcmtd.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR80.dll) > > > 1>libcmtd.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter already defined in MSVCRT.lib(MSVCR80.dll) > > > 1>libcmtd.lib(dbgheap.obj) : error LNK2005: _malloc already defined in MSVCRT.lib(MSVCR80.dll) > > > 1>libcmtd.lib(dbgheap.obj) : error LNK2005: _calloc already defined in MSVCRT.lib(MSVCR80.dll) > > > 1>libcmtd.lib(dbgheap.obj) : error LNK2005: _realloc already defined in MSVCRT.lib(MSVCR80.dll) > > > 1>libcmtd.lib(dbgheap.obj) : error LNK2005: _free already defined in MSVCRT.lib(MSVCR80.dll) > > > Through this is working fine if I do compliation in debug configuration of both library and project. > > > Can anybody have some clues on this? > > > Thanks in advance. > > > Regards, > > > Jaydeep > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > > |
From: OpenSIPStack F. <ope...@op...> - 2008-11-07 06:43:39
|
Hi Joegen, I checked the Multi-threaded DLL option in code generation tab. I have attached the VCPROJ text file with the email. It contains both debug and Release configuration details. For debug it complied fine but for release I get mentioned link errors. <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="SIPUA" ProjectGUID="{152F59B3-DF8A-47F8-8F88-F8DC54A628DA}" RootNamespace="SIPUA" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="2" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="C:\BCM\Code\crm_bcm\bcm\dev\sandbox\jaydeep.gupta\opensipstack_src-1.1.7\opensipstack\include" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SIPUA_EXPORTS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="2" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="C:\BCM\Code\crm_bcm\bcm\dev\sandbox\jaydeep.gupta\opensipstack_src-1.1.7\opensipstack\lib\opensipstackd.lib" LinkIncremental="2" GenerateDebugInformation="true" SubSystem="2" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="2" CharacterSet="1" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="C:\BCM\Code\crm_bcm\bcm\dev\sandbox\jaydeep.gupta\opensipstack_src-1.1.7\opensipstack\include" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SIPUA_EXPORTS" RuntimeLibrary="2" UsePrecompiledHeader="2" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="C:\BCM\Code\crm_bcm\bcm\dev\sandbox\jaydeep.gupta\opensipstack_src-1.1.7\opensipstack\lib\opensipstack.lib" LinkIncremental="1" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File RelativePath=".\SIPUA.cpp" > </File> <File RelativePath=".\stdafx.cpp" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1" /> </FileConfiguration> <FileConfiguration Name="Release|Win32" > <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1" /> </FileConfiguration> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > <File RelativePath=".\phoneapp.h" > </File> <File RelativePath=".\sipphone.h" > </File> <File RelativePath=".\SIPPhoneInterface.h" > </File> <File RelativePath=".\SIPUA.h" > </File> <File RelativePath=".\stdafx.h" > </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > </Filter> <File RelativePath=".\ReadMe.txt" > </File> </Files> <Globals> </Globals> </VisualStudioProject> Thanks. |
From: Joegen E. B. <joe...@gm...> - 2008-11-07 09:02:38
|
I wish I could help you further here but I do not have the slightest idea what's causing your linking error. Surely, OpenSIPStack works links well in release build because I use it everyday when compiling OpenSBC. Have you tried ignoring the multiple definitions using /FORCE:MULTIPLE liker flag. In most cases, /FORCE:MULTIPLE works for me in the past. But sometimes it results to a corrupted binary. Joegen OpenSIPStack Forum wrote: > Hi Joegen, > > > I checked the Multi-threaded DLL option in code generation tab. I have attached the VCPROJ text file with the email. It contains both debug and Release configuration details. For debug it complied fine but for release I get mentioned link errors. > > > Thanks. > > |