error C2761: '{ctor}': redeclaration of member is not allowed

  • Thread starter Thread starter vranjan34
  • Start date Start date
V

vranjan34

Guest
While migrating from Visual studio 2013 to Visual studio 2019 compiler I have got below error. Please help me in fixing the same.

I have declared the function in the header file (.h) below:

#ifndef CSAHCCOMPOSEDITEM_H
#define CSAHCCOMPOSEDITEM_H

#ifdef _UTEST
class CsaHcDICOMComposerTester;
#endif

class EXP_IMP_HcDicComp CsaHcComposedItem
{
#ifdef _UTEST
friend class CsaHcDICOMComposerTester;
#endif

public :

enum CsaHcComposedItemType
{
CISegment,
CIPage,
CILayout,
CIPageBracket,
CIPrintJobBracket,
CIDummy
};

CsaHcComposedItem
(bool &status, CsaHcComposedItemType type_in);

CsaHcComposedItem
();

CsaHcComposedItem a
(const CsaHcComposedItem& compObj_in);

CsaHcComposedItem& operator=
(const CsaHcComposedItem& compObj_in);

~CsaHcComposedItem();

bool operator==
(const CsaHcComposedItem& ci_in);

private : // attributes

CsaHcComposedItemType myType;
CsaHcBasicFilmSession *myBFS;
CsaHcBasicFilmBox *myBFB;
CsaHcBasicImageBox *myBIB;
CsaDib *myDib;
BYTE *myPixelArray;
};

#endif // CSAHCCOMPOSEDITEM_H

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And cpp file contains the definition for the constructor.

//pusedo code

CsaHcComposedItem::CsaHcComposedItem (bool &status_out,
// Return status of the construcor
CsaHcComposedItemType type_in)
// Composed item type
: myType(type_in), // error shown for this line (70)
myBFS(NULL), //line71
myBFB(NULL),
myBIB(NULL),
myDib(NULL),
myPixelArray(NULL)
{
.....
}

Error:

\src/CsaHcComposedItem.cpp(70): error C2761: '{ctor}': redeclaration of member is not allowed
\src/CsaHcComposedItem.cpp(70): error C2059: syntax error: ':'
\src/CsaHcComposedItem.cpp(70): error C2065: 'type_in': undeclared identifier
\src/CsaHcComposedItem.cpp(70): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(71): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(72): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(73): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(74): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(75): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(78): error C2448: 'myPixelArray': function-style initializer appears to be a function definition

Continue reading...
 
Back
Top