Title: Public __gc class

Hi,

I am writing a managed C++ .Net class and putting inside of a nested namespace as follows:

// BEGIN CODE
namespace CJL
{
  namespace System
  {
    public __gc class Semaphore
    {
    public:
      Semaphore(); // default constructor
      ~Semaphore();

    }; // END CLASS DEFINITION Semaphore
  } // END namespace System
} // END namespace CJL
// END CODE

On compilation I am getting the following errors:

        error C2039: 'GC' : is not a member of 'CJL::System'
        error C3861: 'SuppressFinalize': identifier not found, even with argument-dependent lookup

If I remove the nested namespace or the destructor - the above code compiles fine.

Docs say that you can have a user-defined destructor in managed code - however this seems to be causing problems in nested namespaces.

Can anyone help out here - what am I doing wrong?

Thanks in advance,
Craig

----
Craig Lemon - mailto:[EMAIL PROTECTED]
21A Dinton Street, Avonhead
Christchurch, New Zealand, 8004
Mobile: +64 027 4144 211
Ph: +64 (03) 342 7877
----

 

Reply via email to