Iceman2005
Programmer
Hi... i wrote a very simple peice of code in windows..
it compiles and works perfectly... but when i port the code to linux... virtually no code change... it does NOT compile.... it gives me the error....
enum.cpp:14: error: `AA::MyEnum' is not an aggregate type
enum.cpp: In function `int main()':
enum.cpp:23: error: `AA::MyEnum' is not an aggregate type
does anyone know why? and how do i make it comppile on linux? thanks.
CODE.............
#include "stdafx.h"
class AA {
public:
enum MyEnum {
x = 1,
y = 2,
z = 4
};
void foo(const MyEnum ee = MyEnum::x)
{
}
};
int main()
{
AA aa;
aa.foo(AA::MyEnum::x);
return 0;
}
thanks,
iceman
it compiles and works perfectly... but when i port the code to linux... virtually no code change... it does NOT compile.... it gives me the error....
enum.cpp:14: error: `AA::MyEnum' is not an aggregate type
enum.cpp: In function `int main()':
enum.cpp:23: error: `AA::MyEnum' is not an aggregate type
does anyone know why? and how do i make it comppile on linux? thanks.
CODE.............
#include "stdafx.h"
class AA {
public:
enum MyEnum {
x = 1,
y = 2,
z = 4
};
void foo(const MyEnum ee = MyEnum::x)
{
}
};
int main()
{
AA aa;
aa.foo(AA::MyEnum::x);
return 0;
}
thanks,
iceman