This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Static Const


I am trying to declare a static const member like this...

   class RemoteManager:public Runnable{
   ...
    public:
     ...
-->  static const char MANAGEMENT_INTERFACE[] = "127.0.0.1";
     ...
   };

but when compiling, keep getting this...

g++ -g -Wno-deprecated -I /downloads/xerces/xerces-c-src_2_3_0/include/
-c remotemanager.cpp
In file included from remotemanager.cpp:7:
remotemanager.h:15: invalid in-class initialization of static data
member of
   non-integral type `const char[]'
make: *** [remotemanager.o] Error 1

I'm missing something small here, but I'm not seeing it.  Seems to be
object related because the same line of code in a simple main() function
works fine.  Thoughts?

Thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thomas Paine (paineta@uwec.edu)
University of Wisconsin - Eau Claire


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]