<div dir="ltr">Hi,<div>In my C++ code I am initialising my data members in the header file (example below)</div><div><br></div><div><font color="#0000ff" face="monospace, monospace">class foo{</font></div><div><font color="#0000ff" face="monospace, monospace">public:</font></div><div><font color="#0000ff" face="monospace, monospace"> int myInt =0;</font></div><div><font color="#0000ff" face="monospace, monospace">....</font></div><div><font color="#0000ff" face="monospace, monospace">}</font></div><div><br></div><div>When I create the Makefile using cmake, and try to compile the compiler trows an error that </div><div><br></div><div> <font color="#0000ff" face="monospace, monospace">error: ISO C++ forbids initialization of member ?myInt?<br></font></div><div><br></div><div>I am using the "<font color="#0000ff" face="monospace, monospace">-std=c++0x</font>" flag in my <font color="#0000ff">CMakeLists.txt</font> file.</div><div><br></div><div>This is a standard feature and I am puzzled why the compiler is complaining with the CMake generate Makefile.</div><div><br></div><div>Any expert comments?</div><div><br></div>Thanks,<br>Chiranjib</div>