[Qt-interest] Error in defining a static data member to a class

Akshey Jawa aksheyjawa at gmail.com
Wed Oct 28 12:21:46 CET 2009


Hi,

I am getting an error in defining a static data member to a class. The
declaration of the static member does not give any error but when I define
the variable then I get an the error. Example--

I got error for this statement-
*int ClassName::temp=0;*

*Error:*  multiple definition of `ClassName::temp'.
first defined here: main.o:/usr/include/c++/4.2/bits/locale_facets.tcc:2560

I have tried changing the names of the identifiers and also tried
introducing static data members in some other working code, but I get
similar errors. I am using Qt Creator but I get same error on command line
also.

Please help

Regards,
Akshey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091028/5f424e63/attachment.html 


More information about the Qt-interest-old mailing list