Hi,
I have the following problem
The below class is fully defined in the header file thus there's no
..cpp-file. The header-file is included in several lib's I'm using.
----------
#pragma once
class CCriticalSectionGuard ;
class CCriticalSection
{
friend class CCriticalSectionGuard ;
..
..
};
class CCriticalSectionGuard
{
..
..
};
--------
Now I use this class in several other classes but when I compile the
compiler (Visual Studio 2005) gives me the following error statement:
error C2011: 'CCriticalSection' : 'class' type redefinition
CriticalSectionGuard.h
Thinking of it I get this when I try to compile into a .dll but not
when I compile into a .lib (which I use in the .dll-file) and they
basically uses the same libs. Anyone got any inputs?
I've checked the following things: there's no duplicate files in any
include paths, there's no duplication of the class name in any other
include file. All project headers starts with the #pragma once
directive (thus adding #ifndef wont help - I've tried that as well...).
Please help,
Martin