From kde-devel Tue Jun 22 20:28:53 1999 From: Rik Hemsley Date: Tue, 22 Jun 1999 20:28:53 +0000 To: kde-devel Subject: YA daft C++ q X-MARC-Message: https://marc.info/?l=kde-devel&m=93008239619127 Ok, seeing as people are talking about using namespaces, I'm presuming it's ok to use them now. I had a class which I was using as a namespace, with some enums, static methods, and some of this: static const QCString monthNames[] I define the above in the .cpp file: const QCString RMM::monthNames[] = { "Jan", "Feb" ... } Now if I change the class to a namespace: namespace RMM { static const QCString monthNames[]; ... }; While the .cpp is still compiled to an object, and it's unchanged, I get undefined reference on linking to the QCString arrays. The enums are ok, the static methods are converted to non-static, and they're ok, it's just the arrays. Anyone know what I'm doing wrong ? Note: Putting 'using RMM;' at the top of the .cpp doesn't work. Should it ? I'm just leaving the 'RMM::' on everything for now. Cheers, Rik -- KDE - Colour outside the lines : http://www.kde.org [[without]] - software for KDE : http://without.netpedia.net