Template Macros in VS2003
Stromek
stromek at realtime.sk
Sun Jan 21 20:30:20 CET 2007
On Thu, Jan 18, 2007 at 05:10:54PM -0800, Ryan Loebs wrote:
> Hello again!
>
> I decided to start fresh and did a clean SVN grab to make sure there
> weren't any parts I missed. One error that I got before and am still
> getting is with the plastik and keramik packages. The macro
> K_EXPORT_STYLE(name, type) produces this error in VS2003:
>
> plastik.cpp(60) : error C2947: expecting '>' to terminate
> template-argument-list, found '>>'
>
> Which, when I googled it, is fixed with a simple space in between a
> few arguments in most cases. It didn't work here though.... I can
> bypass the error by commenting out the line but then I assume the
> themes are never registered which probably causes some issues. If
> there's a way to fix this without having to upgrade to VS2005 I'd love
> to know how.
Yep, there is a way. As you wrote, inserting a simple space :) However
it has to be inserted on the right place.
First things first, it looks like this is a known compiler error which
according the following microsoft page won't be fixed in msvc7.
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98665
The real error is caused by expanding Q_EXPORT_PLUGIN with argument which is of template type as defined in K_EXPORT_STYLE. One way is to make typedef something like
typedef KStyleFactory< KeramikStyle > KStyleFactory_KeramikStyle;
Q_EXPORT_PLUGIN( KStyleFactory_KeramikStyle )
However, I don't know whether this can be automated by symbol definition
because something like #define foo( type ) typedef foo_type doesn't
expand type.
The second way is to modify qplugin.h (QTDIR\src\corelib\plugin\qplugin.h)
--- qplugin.h 2007-01-21 19:47:19.000000000 +0100
+++ qplugin.orig.h 2007-01-21 20:09:31.000000000 +0100
@@ -54,7 +54,7 @@
#define Q_PLUGIN_INSTANCE(IMPLEMENTATION) \
{ \
- static QPointer< IMPLEMENTATION > _instance; \
+ static QPointer<IMPLEMENTATION> _instance; \
if (!_instance) \
_instance = new IMPLEMENTATION; \
return _instance; \
Maybe it can be handled by windbus\QtDBus-win32.patch. Or?
Happy compiling :)
--
Stromek
More information about the Kde-windows
mailing list