Menu

#178 Ovctcmmn.hpp bug and how to fix it

open
nobody
None
5
2014-07-28
2006-10-29
JLow
No

The BDS2006 C++ compiler detected the following error
on file Ovctcmmn.hpp

[C++ Error] Ovctcmmn.hpp(121): E2019
'TCellComboBoxInfo:: :: :: ()' cannot be declared in an
anonymous union

Hereafter I present the boggus code (row 109 to 129)

struct TCellComboBoxInfo
{

public:
int Index;
union
{
struct
{
Classes::TStrings* RTItems;
System::ShortString RTSt;

    \};
    struct 
    \{
        System::ShortString St;

    \};

\};

} ;

Bellow you can find how I fix it ((see the comments).

struct TCellComboBoxInfo
{

public:
int Index;
union u // "u" was added by me
{
struct s1 // "s1" was added by me
{
Classes::TStrings* RTItems;
System::ShortString RTSt;

    \};
    struct s2  // "s2" was added by me
    \{
        System::ShortString St;

    \};

\};

} ;

Discussion


Log in to post a comment.