Well, to help us help you, run this in a debugger, and step through, and see exactly on which line it crashes.
Also, the extern keyword use here is very strange - and probably points to a design problem, in OOP and C++, you hardly ever need to define extern.
You should at least test that the string really is initialized.