incompatibility between g++ and vc++

Vincent Torri torri@math.u-strasbg.fr
Wed Jun 9 09:06:00 GMT 2004


Hello,

one of my friend is writing a c++ program and compile it with vc++ on
windows. He has no compilation error.

I wanted to test it on linux, but g++ report an error.

Here is a part of the source code : 

template <class Clock> class timer : boost::noncopyable
{

  static Clock const clock_;   //Clock instance

  // methods

  ...


};

//instantation of the clock_ static member
template <class Clock>
Clock const timer<Clock>::clock_;


And g++ reports this error:
                               
l98: uninitialized const                                                        
`avs::timing::timer<avs::timing::ThreadClock>::clock_' 

I have tried to understand why g++ reduses to initialize clock_, without
success.

Does someone know where (what) is the error ? If you want more code, tell
me.

Thank you !

Vincent TORRI




More information about the Gcc-help mailing list