locked
Problem with build VSC ++ 2012 RC

    Question

  • Hi everyone! Could anybody explain me the compile error:

    The common base class:

    #pragma once
    #include "imagedef.h"
    class  CBaseImage 
    {
    protected:
    	ImageParametersTp Parameters;
    public:
    	ImageParametersTp& GetImageParameters() {return Parameters;}; 
    };
    typedef CBaseImage BaseImageTp;
    typedef BaseImageTp* PBaseImageTp;

    The abstract class for all image files:

    #pragma once
    #include "BaseImage.h"
    #include "UserImage.h"
    #include "ImageDef.h"
    class CFileImage :	public CBaseImage
    {
    protected:
    public:
    	virtual	VOID  LoadRawImage(RawImageTp, DWORD, DWORD, DWORD, DWORD) abstract;
    	virtual PUserImageTp GetUserImage() abstract;
    };
    typedef CFileImage FileImageTp;
    typedef FileImageTp *PFileImageTp;

    The abstract class for all user images:

    #pragma once
    #include "BaseImage.h"
    #include "FileImage.h"
    class CUserImage  :	public CBaseImage
    {
    protected:
    	PFileImageTp	File;
    	CUserImage(PFileImageTp file);
    	CUserImage(){;};
    public:
    	virtual VOID	Load() abstract;
    	virtual WORD	GetPixelSample(DWORD i, DWORD j) abstract;
    	virtual	BYTE	GetNumberSample() abstract;
    };
    typedef CUserImage UserImageTp;
    typedef UserImageTp *PUserImageTp;

    The build errors:

    fileimage.h(13): error C2146: syntax error : missing ';' before identifier 'GetUserImage'
    fileimage.h(13): error C2433: 'CFileImage::PUserImageTp' : 'virtual' not permitted on data declarations
    fileimage.h(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    fileimage.h(13): error C2253: 'CFileImage::GetUserImage' : pure specifier or abstract override specifier only allowed on virtual function

    What's wrong?

    If it's wrong forum thread, please give me right. The code work in old VSC++....


    Best Regards, Alexander


    • Edited by InfoSputnik Wednesday, June 27, 2012 8:21 PM
    Wednesday, June 27, 2012 7:10 PM

Answers

  • It seems that PUserImageTp type is not defined when fileimage.h is
    processed. Check the include files you include before including
    fileimage.h. A header file containing the definition of PUserImageTPO
    must be included before fileimage.h.
    For C++ questions that are not Metro specific, you may use the General
    C++ forum
     
    • Marked as answer by InfoSputnik Thursday, June 28, 2012 4:21 AM
    Wednesday, June 27, 2012 11:00 PM