uafxcw.lib(dllmodul.obj) : error LNK2005: [email protected] already defined

I am trying to compile ATL project but I get the following error:

Linking…

Searching libraries

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinmm.lib:

Searching ..CTIAdapterLibReleaseCTIAdapterLib.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libkernel32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuser32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibgdi32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinspool.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibcomdlg32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibadvapi32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibshell32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibole32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboleaut32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuuid.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibodbc32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibodbccp32.lib:

Searching DevelopmentWindows 800.0.0CDSCallControlForWindowsCTIAdapterCTIAdapterLibReleaseCTIAdapterLib.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibuafxcw.lib:

uafxcw.lib(dllmodul.obj) : error LNK2005: [email protected] already defined in CTIAdapter.obj

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libmsvcrt.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibmsimg32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibcomctl32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibshlwapi.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboledlg.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliburlmon.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibatls.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libOLDNAMES.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libcomsupp.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libmsvcprt.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibatl.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwininet.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibws2_32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibmswsock.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboleacc.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinmm.lib:

Searching ..CTIAdapterLibReleaseCTIAdapterLib.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libkernel32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuser32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibgdi32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinspool.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibcomdlg32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibadvapi32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibshell32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibole32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboleaut32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuuid.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibodbc32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibodbccp32.lib:

Searching DevelopmentWindows 800.0.0CDSCallControlForWindowsCTIAdapterCTIAdapterLibReleaseCTIAdapterLib.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibuafxcw.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libmsvcrt.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibmsimg32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibcomctl32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibshlwapi.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboledlg.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliburlmon.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibatls.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libOLDNAMES.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libcomsupp.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libmsvcprt.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibatl.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwininet.lib:

Searching C:Program FilesMicroso

ft Visual Studio .NET 2003Vc7PlatformSDKlibws2_32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibmswsock.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboleacc.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinmm.lib:

Searching ..CTIAdapterLibReleaseCTIAdapterLib.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libkernel32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuser32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibgdi32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinspool.lib:

Finished searching libraries

uafxcw.lib(dllmodul.obj) : warning LNK4006: [email protected] already defined in CTIAdapter.obj; second definition ignored

Creating library Release/CTIAdapter.lib and object Release/CTIAdapter.exp

Searching libraries

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinmm.lib:

Searching ..CTIAdapterLibReleaseCTIAdapterLib.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libkernel32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuser32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibgdi32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinspool.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibcomdlg32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibadvapi32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibshell32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibole32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboleaut32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuuid.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibodbc32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibodbccp32.lib:

Searching DevelopmentWindows 800.0.0CDSCallControlForWindowsCTIAdapterCTIAdapterLibReleaseCTIAdapterLib.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibuafxcw.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libmsvcrt.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibmsimg32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibcomctl32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibshlwapi.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboledlg.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliburlmon.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibatls.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libOLDNAMES.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libcomsupp.lib:

Searching C:

Program FilesMicrosoft Visual Studio .NET 2003Vc7libmsvcprt.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibatl.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwininet.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibws2_32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibmswsock.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboleacc.lib:

Finished searching libraries

Searching libraries

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinmm.lib:

Searching ..CTIAdapterLibReleaseCTIAdapterLib.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libkernel32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuser32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibgdi32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinspool.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibcomdlg32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibadvapi32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibshell32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibole32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboleaut32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuuid.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibodbc32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibodbccp32.lib:

Searching DevelopmentWindows 800.0.0CDSCallControlForWindowsCTIAdapterCTIAdapterLibReleaseCTIAdapterLib.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibuafxcw.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libmsvcrt.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibmsimg32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibcomctl32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibshlwapi.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboledlg.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliburlmon.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibatls.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libOLDNAMES.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libcomsupp.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libmsvcprt.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibatl.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwininet.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibws2_32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibmswsock.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboleacc.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinmm.lib:

Searching ..CTIAdapterLibReleaseCTIAdapterLib.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7libkernel32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuser32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibgdi32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibwinspool.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibcomdlg32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibadvapi32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibshell32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibole32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKliboleaut32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuuid.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibodbc32.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibodbccp32.lib:

Searching DevelopmentWindows 800.0.0CDSCallControlForWindowsCTIAdapterCTIAdapterLibReleaseCTIAdapterLib.lib:

Searching C:Program FilesMicrosoft Visual Studio .NET 2003Vc7atlmfclibuafxcw.lib:

Finished searching libraries

Microsoft (R) 32b/64b MIDL Compiler Version 6.00.0361

Copyright (c) Microsoft Corporation 1991-2002. All rights reserved.

Processing ._CTIAdapter.idl

_CTIAdapter.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludemshtml.idl

mshtml.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludeocidl.idl

ocidl.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludeoleidl.idl

oleidl.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludeobjidl.idl

objidl.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludeunknwn.idl

unknwn.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludewtypes.idl

wtypes.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludebasetsd.h

basetsd.h

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludeguiddef.h

guiddef.h

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludeoaidl.idl

oaidl.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludeservprov.idl

servprov.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludeurlmon.idl

urlmon.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludemsxml.idl

msxml.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludedimm.idl

dimm.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludemshtmhst.idl

mshtmhst.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludedocobj.idl

docobj.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludeobjsafe.idl

objsafe.idl

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludeoaidl.acf

oaidl.acf

Processing C:Program FilesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKincludeocidl.acf

ocidl.acf

uafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___wargv

uafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc

Release/CTIAdapter.dll : fatal error LNK1120: 2 unresolved externals

Build log was saved at “file://d:Development\CTIAdapterCTIAdapterReleaseBuildLog.htm

CTIAdapter – 4 error(s), 6 warning(s)

———————- Done ———————-

Build: 1 succeeded, 1 failed, 0 skipped

If I compile the project without including the it compiles OK without error. but I needed this file for COleMessageFilter in my project.

Any Ideas!!!

You cannot define DllMain for MFC projects. MFC has its own initialization mechanism.It’s not clear to me whether you’re building or using CTIAdapter.lib (actually it looks like both at the same time :-o) Anyway, you may want to take a look at the file that is used to build CTIAdapter.obj. You shouldn’t define DllMain in there.-hg/

I solved similiar problem by removing “_USRDLL”  preprocessor definition.I hope it helps you too.

Yes !! – this solved the problem for me as well. Thanks.