tags:

views:

118

answers:

3

Following code is not compiling, can anybody please help what is wrong here

class CTrapInfo
{
public:
    enum GenericType
    {
        ColdStart,    
        WarmStart,
        LinkDown,    
        LinkUp,
        AuthenticationFailure,    
        EGPNeighborLoss,
        EnterpriseSpecific
    };
    CTrapInfo();
    CTrapInfo(const CTrapInfo&);
    ~CTrapInfo();   
    CTrapInfo &operator=(const CTrapInfo&);
    static GenericType toGenericType(const DOMString&);
};

Compiler error is :

error C4430: missing type specifier - int assumed.

Note: C++ does not support default-int MSDN says this is valid in c++ http://msdn.microsoft.com/en-us/library/2dzy4k6e%28VS.80%29.aspx

+2  A: 

It compiles for me, in VS2005, if I forward declare class CAPTrapInfo and class DOMSTring.

bakerian
I am also using the same VS2005 professional edition.
Avinash
Sorry you was right I forget to add DOMString . my mistake
Avinash
@Avinash: it's a little hard to follow this question-page, so please select this as the correct answer.
Potatoswatter
A: 

Are you sure CAPTrapInfo and DOMString are defined? If they are not defined you will get the error.

Arve
That was a typo and DOMstring is included in my header file
Avinash
A: 

For which line does the compiler indicate the error? It could be that you did not include a definition for DOMString, so that the compiler might assume int in toGenericType(const DOMString&).

phresnel