我是VC ++的新手,所以请原谅我,如果这是愚蠢的。
我在一个项目下有7个解决方案。其中六个构建静态库,它们在第7个内部链接以生成exe。所有项目的运行时配置都是MultiThreaded Debug。 用于生成exe的sln是使用MFC其他slns使用标准runtiem库。我尝试将它们更改为MFC,但我仍然遇到同样的错误。 所有六个slns成功建立。 当我尝试构建exe时 - 得到以下错误:
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *,int,char const *,int)" (??3@YAXPAXHPBDH@Z) already defined in tara_common.lib(fileStream.obj)
这很奇怪,因为tara_common是我生成的lib之一,而fileStream.cpp就是在指针上使用delete的文件。
我用verbose mod构建它,所以我附加了输出。
ENVIRONMENT SPACE
_ACP_ATLPROV=C:\Program Files\Microsoft Visual Studio 9.0\VC\Bin\ATLProv.dll
_ACP_INCLUDE=C:\Program Files\Microsoft Visual Studio 9.0\VC\include;C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include;C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include;C:\Program Files\Microsoft SDKs\Windows\v6.0A\include
_ACP_LIB=C:\fta\tara\database\build\Debug;C:\Program Files\Microsoft Visual Studio 9.0\VC\lib;C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\lib;C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\lib\i386;C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib;C:\Program Files\Microsoft Visual Studio 9.0\;C:\Program Files\Microsoft Visual Studio 9.0\lib
_ACP_PATH=C:\Program Files\Microsoft Visual Studio 9.0\VC\bin;C:\Program Files\Microsoft SDKs\Windows\v6.0A\\bin;C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio 9.0\Common7\tools;C:\Program Files\Microsoft Visual Studio 9.0\Common7\ide;C:\Program Files\HTML Help Workshop;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin;c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 9.0\;C:\WINDOWS\SysWow64;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft Visual Studio 9.0\VC\bin;C:\Program Files\GnuWin32\bin;C:\Python26
ALLUSERSPROFILE=C:\Documents and Settings\All Users
CLIENTNAME=Console
CommonProgramFiles=C:\Program Files\Common Files
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
INCLUDE=C:\Program Files\Microsoft Visual Studio 9.0\VC\include;C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include;C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include;C:\Program Files\Microsoft SDKs\Windows\v6.0A\include
LIB=C:\fta\tara\database\build\Debug;C:\Program Files\Microsoft Visual Studio 9.0\VC\lib;C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\lib;C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\lib\i386;C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib;C:\Program Files\Microsoft Visual Studio 9.0\;C:\Program Files\Microsoft Visual Studio 9.0\lib
LIBPATH=c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\lib;C:\Program Files\Microsoft Visual Studio 9.0\VC\lib
LOGONSERVER=\\xxx
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
PATH=C:\Program Files\Microsoft Visual Studio 9.0\VC\bin;C:\Program Files\Microsoft SDKs\Windows\v6.0A\\bin;C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio 9.0\Common7\tools;C:\Program Files\Microsoft Visual Studio 9.0\Common7\ide;C:\Program Files\HTML Help Workshop;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin;c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 9.0\;C:\WINDOWS\SysWow64;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft Visual Studio 9.0\VC\bin;C:\Program Files\GnuWin32\bin;C:\Python26
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 10, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=170a
ProgramFiles=C:\Program Files
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
VisualStudioDir=C:\Documents and Settings\sgupta\My Documents\Visual Studio 2008
VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\
WecVersionForRosebud.710=2
windir=C:\WINDOWS
COMMAND LINES:
Creating temporary file "c:\fta\tools\channel_editor\IvoDB\Debug\RSP00011018082288.rsp" with contents
[
/VERBOSE /OUT:"C:\fta\tools\channel_editor\\Builds\IvoDB_1_35_Debug.exe" /INCREMENTAL /LIBPATH:"..\..\..\3rdparty\boost_1_42_0\stage\lib" /MANIFEST /MANIFESTFILE:"Debug\IvoDB_1_35_Debug.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DELAYLOAD:"OleAcc.dll" /DEBUG /PDB:"C:\fta\tools\channel_editor\Builds\IvoDB_1_35_Debug.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /MACHINE:X86 ..\..\..\tara\database\build\Debug\tara_database.lib ..\..\..\tara\common\build\Debug\tara_common.lib ..\..\..\3rdparty\sqliteWrapper\Debug\sqliteWrapper.lib ..\..\..\3rdparty\sqlite_3_6_18\Debug\sqlite.lib ..\..\..\stsdk\modules\win32\Debug\modules.lib ..\..\..\stsdk\axeapi\win32\Debug\axeapi.lib DelayImp.lib
".\Debug\AntennaSettings.obj"
".\Debug\AudioVideoSettings.obj"
".\Debug\CMDatabase.obj"
".\Debug\CMSettings.obj"
".\Debug\ColorFileDialog.obj"
".\Debug\ColorStatic.obj"
".\Debug\DragDropListCtrl.obj"
".\Debug\DragDropTreeCtrl.obj"
".\Debug\FavouriteEdit.obj"
".\Debug\FavTab.obj"
".\Debug\FindProgram.obj"
".\Debug\HyperLink.obj"
".\Debug\IvoDB.obj"
".\Debug\IvoDBDlg.obj"
".\Debug\IvoDBInfo.obj"
".\Debug\IvoDBInfoTab.obj"
".\Debug\IvoDbStruct.obj"
".\Debug\LayoutHelper.obj"
".\Debug\MainTab.obj"
".\Debug\OperTabCtrl.obj"
".\Debug\ParentalLock.obj"
".\Debug\ProgramEdit.obj"
".\Debug\ProgramTab.obj"
".\Debug\PVRSettings.obj"
".\Debug\SatTab.obj"
".\Debug\SettingsBase.obj"
".\Debug\SettingsTab.obj"
".\Debug\STBSettings.obj"
".\Debug\stdafx.obj"
".\Debug\TimeDate.obj"
".\Debug\TransponderEdit.obj"
".\Debug\TreeTab.obj"
".\Debug\UserPreferences.obj"
".\Debug\Xmodem.obj"
".\Debug\IvoDB.res"
".\Debug\IvoDB_1_35_Debug.exe.embed.manifest.res"
]
Creating command line "link.exe @c:\fta\tools\channel_editor\IvoDB\Debug\RSP00011018082288.rsp /NOLOGO /ERRORREPORT:PROMPT"
**Processed /DEFAULTLIB:atlsd.lib
Processed /DEFAULTLIB:ws2_32.lib
Processed /DEFAULTLIB:mswsock.lib
Processed /DISALLOWLIB:mfc90d.lib
Processed /DISALLOWLIB:mfcs90d.lib
Processed /DISALLOWLIB:mfc90.lib
Processed /DISALLOWLIB:mfcs90.lib
Processed /DISALLOWLIB:mfc90ud.lib
Processed /DISALLOWLIB:mfcs90ud.lib
Processed /DISALLOWLIB:mfc90u.lib
Processed /DISALLOWLIB:mfcs90u.lib
Processed /DISALLOWLIB:uafxcwd.lib
Processed /DISALLOWLIB:uafxcw.lib
Processed /DISALLOWLIB:nafxcw.lib
Found "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
Referenced in axeapi.lib(ipcgeneric.obj)
Referenced in axeapi.lib(ipccommon.obj)
Referenced in axeapi.lib(activeobject.obj)
Referenced in nafxcwd.lib(nolib.obj)
Referenced in sqliteWrapper.lib(DbConnection.obj)
Referenced in sqliteWrapper.lib(Statement.obj)
Referenced in axeapi.lib(nvstorage.obj)
Referenced in axeapi.lib(avctrler.obj)
Referenced in tara_common.lib(trace.obj)
Referenced in tara_common.lib(ssPrintf.obj)
Referenced in tara_common.lib(taraConfig.obj)
Referenced in tara_common.lib(stream.obj)
Referenced in tara_common.lib(STBConfigurationStorage.obj)
Referenced in tara_common.lib(STBConfiguration.obj)
Referenced in tara_common.lib(configParser.obj)
Referenced in tara_common.lib(fileStream.obj)
Referenced in tara_database.lib(SatStream.obj)
Referenced in tara_database.lib(Service.obj)
Referenced in tara_database.lib(ServiceList.obj)
Referenced in tara_common.lib(playerConfig.obj)
Referenced in UserPreferences.obj
Referenced in Xmodem.obj
Referenced in tara_database.lib(init.obj)
Referenced in tara_database.lib(Satellite.obj)
Referenced in TransponderEdit.obj
Referenced in TreeTab.obj
Referenced in TreeTab.obj
Referenced in UserPreferences.obj
Referenced in stdafx.obj
Referenced in TimeDate.obj
Referenced in TimeDate.obj
Referenced in TransponderEdit.obj
Referenced in SettingsTab.obj
Referenced in SettingsTab.obj
Referenced in STBSettings.obj
Referenced in STBSettings.obj
Referenced in SatTab.obj
Referenced in SatTab.obj
Referenced in SettingsBase.obj
Referenced in SettingsBase.obj
Referenced in ProgramTab.obj
Referenced in ProgramTab.obj
Referenced in PVRSettings.obj
Referenced in PVRSettings.obj
Referenced in ParentalLock.obj
Referenced in ParentalLock.obj
Referenced in ProgramEdit.obj
Referenced in ProgramEdit.obj
Referenced in MainTab.obj
Referenced in MainTab.obj
Referenced in OperTabCtrl.obj
Referenced in OperTabCtrl.obj
Referenced in IvoDBInfoTab.obj
Referenced in IvoDbStruct.obj
Referenced in LayoutHelper.obj
Referenced in LayoutHelper.obj
Referenced in IvoDBDlg.obj
Referenced in IvoDBInfo.obj
Referenced in IvoDBInfo.obj
Referenced in IvoDBInfoTab.obj
Referenced in HyperLink.obj
Referenced in IvoDB.obj
Referenced in IvoDB.obj
Referenced in IvoDBDlg.obj
Referenced in FavTab.obj
Referenced in FavTab.obj
Referenced in FindProgram.obj
Referenced in FindProgram.obj
Referenced in DragDropTreeCtrl.obj
Referenced in DragDropTreeCtrl.obj
Referenced in FavouriteEdit.obj
Referenced in FavouriteEdit.obj
Referenced in ColorFileDialog.obj
Referenced in ColorStatic.obj
Referenced in DragDropListCtrl.obj
Referenced in DragDropListCtrl.obj
Referenced in CMDatabase.obj
Referenced in CMDatabase.obj
Referenced in CMSettings.obj
Referenced in CMSettings.obj
Referenced in AntennaSettings.obj
Referenced in AntennaSettings.obj
Referenced in AudioVideoSettings.obj
Referenced in AudioVideoSettings.obj
Loaded nafxcwd.lib(afxmem.obj)
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *,int,char const *,int)" (??3@YAXPAXHPBDH@Z) already defined in tara_common.lib(fileStream.obj)**
请帮帮我,我已经浪费了3天的时间在网上寻找所有可能的解决方案。
提前谢谢, SG答案 0 :(得分:4)
通常这意味着您尝试链接可执行文件(.EXE和.DLL),这些文件链接到不同版本的运行时库。 (如果将DLL链接到一起或链接到EXE文件,通常应该使用动态版本的RTL。)