Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

error C2370: 'LIBID_ATLLib' : redefinition; different storage class

126 views
Skip to first unread message

Unknown User

unread,
Mar 29, 2001, 11:43:55 PM3/29/01
to

Hello,

I am new to Component Object Model (COM) and am having a difficult
time understanding the concepts, let alone the code.

I was trying to compile a simple example from a book. The project
name is "ATL". The compiler is issuing the following error message:

error C2370: 'LIBID_ATLLib' : redefinition; different storage class
atlbase.h(79) : see declaration of 'LIBID_ATLLib'

This is the line in the "ATL_i.c" (generated by the compiler)
triggering the error C2370:

const IID LIBID_ATLLib =
{0x462414AC,0xF1F1,0x47FA,{0xA6,0x25,0x0A,0xF4,0x91,0x0A,0x3B,0xEE}};

The declaration of 'LIBID_ATLLib' in the atlbase.h is

extern "C" const __declspec(selectany) GUID LIBID_ATLLib =
{0x44EC0535,0x400F,0x11D0,{0x9D,0xCD,0x00,0xA0,0xC9,0x03,0x91,0xD3}};

What is causing this error and how can it be fixed? Thanks for your
help.

yhhuang

unread,
Apr 1, 2001, 11:53:36 PM4/1/01
to

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
==========
1. In the <project_name>.idl file change the name of the library from
ATLLib to something else.
2. Do not use 'ATL' for your project name.

yhhuang
ICQ:91074870

0 new messages