Hi all,<div><br></div><div>I trying build the following simple code that use a static const variable inside a class but I got an undefinend reference error :</div><div><br></div><div><div>#include <iostream></div><div>
<br></div><div>using namespace std;</div><div><br></div><div>class Test</div><div>{</div><div> public :</div><div> static const double value = 10.0;</div><div>};</div><div><br></div><div><br></div><div>int main()</div>
<div>{</div><div> cout << "hello " << Test::value << endl;</div><div> return 0;</div><div>}</div></div><div><br></div><div>This code produce the following warning and error at link time :</div>
<div><br></div><div><div>clang: warning: argument unused during compilation: '-cc1'</div><div>/home/jrabarisoa/Sandbox/test_clang/main.cpp:27:25: warning: in-class initializer for static data member of type 'const double' is a</div>
<div> C++0x extension [-Wc++0x-extensions]</div><div> static const double value = 10.0;</div><div> ^ ~~~~</div><div>1 warning generated.</div><div>Linking CXX executable test</div><div>
g++: unrecognized option '-cc1'</div><div>CMakeFiles/test.dir/main.cpp.o: In function `main':</div><div>/home/jrabarisoa/Sandbox/test_clang/main.cpp:(.text+0x7a): undefined reference to `Test::value'</div>
<div>collect2: ld returned 1 exit status</div></div><div><br></div><div>What I've missed ?</div><div><br></div><div>I use the latest clang from the svn repository.</div><div><br></div><div>Regards,</div><div><br></div>
<div>Jaonary</div>