PRB: ATL Project Named "ATL" Fails to Build
Article ID: 198018
Article Last Modified on 9/12/2003
APPLIES TO
- Microsoft ActiveX Template Library 3.0, when used with:
- Microsoft Visual C++ .NET 2002 Standard Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
- Microsoft Visual C++ .NET 2003 Standard Edition
This article was previously published under Q198018
SYMPTOMS
When you build an ATL project with the name 'ATL' you will
C2370: 'LIBID_ATLLib' : redefinition; different storage class
c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(79) : see
declaration of 'LIBID_ATLLib'
The project can be an inproc server,
local server or service and the project name's case does not matter.
In Visual Studio .NET you receive the following error message:
ATL_i.obj : error LNK2005: _LIBID_ATLLib already defined
in stdafx.obj ATL_i.obj : warning LNK4006: _LIBID_ATLLib already defined in
stdafx.obj; second definition ignored
Creating library Debug/ATL.lib and
object Debug/ATL.exp Debug/ATL.dll : fatal error LNK1169: one or more multiply
defined symbols found
CAUSE
When you create a ATL project with the name 'ATL', the type
library is give a name ATLLib and the midl generated header files generates a
GUID named LIBID_ATLLib. This GUID name is already used in the ATL header files
and so the redefinition error. ATL uses the GUID name for the registrar object
and the control containment code.
RESOLUTION
- In the <project_name>.idl file change the name of the
library from
ATLLib to something else.
- Do not use 'ATL' for your project name.
Additional query words: kbDSupport
Keywords: kbprb KB198018