Q:

Initialize static variables in C++ class? 

I have noticed that some of my functions in a class are actually not accessing the object, so I made them static.  Then the compiler told me that all variables they access must also be static – well, quite understandable so far.  I have a bunch of string variables such as
string RE_ANY = "([^\\n]*)";
string RE_ANY_RELUCTANT = "([^\\n]*?)"; 

and so on in the class.  I have then made them all static const because they never change.  However, my program only compiles if I move them out of the class: Otherwise, MSVC++2010 complains "Only static constant integral variables may be initialized within a class". 
Well that's unfortunate.  Is there a workaround?  I would like to leave them inside the class they belong to. 

A:

They can't be initialised inside the class, but they can be initialised outside the class, in a source file:
// inside the class
class Thing {
    static string RE_ANY;
    static string RE_ANY_RELUCTANT;
};

// in the source file
string Thing::RE_ANY = "([^\\n]*)";
string Thing::RE_ANY_RELUCTANT = "([^\\n]*?)"; 

Update
I've just noticed the first line of your question - you don't want to make those functions static, you want to make them const.  Making them static means that they are no longer associated with an object (so they can't access any non-static members), and making the data static means it will be shared with all objects of this type.  This may well not be what you want.  Making them const simply means that they can't modify any members, but can still access them. 

A:

Mike Seymour has given you the right answer, but to add...
C++ lets you declare and define in your class body only static const integral types, as the compiler tells.  So you can actually do:
class Foo
{
    static const int someInt = 1;
    static const short someShort = 2;
    // etc. 
};

And you can't do that with any other type, in that cases you should define them in your .cpp file. 

A:

Static member variables must be declared in the class and then defined outside of it! 
There's no workaround, just put their actual definition in a source file. 

From your description it smells like you're not using static variables the right way.  If they never change you should use constant variable instead, but your description is too generic to say something more. 
Static member variables always hold the same value for any instance of your class: if you change a static variable of one object, it will change also for all the other objects (and in fact you can also access them without an instance of the class - ie: an object).