Visual Studio 6 Compiler Error

Charlie,

I have had some experience with both versions of the MSVC++ compiler. The C++ compiler that
comes with VS6 is not as good at handling templates, but there are some tricks you can do to
force the compiler to do what you want.

A lot of times you can achieve this with more formal C++ (remember that the language
specification lets us take some shortcuts)

Try this on line #362:

this->_fill_and_stroke< agg::ellipse >( path, gc, face );

and do the appropriate similair reeplacement on the other lines. I no longer have VS6
installed on any machines that I have access to, so I cannot test this, but I believe that
this should work.

--James

···

Date: Wed, 12 Apr 2006 19:48:43 -0400
From: "Charlie Moad" <cwmoad@...149...>
To: "matplotlib development list" <matplotlib-devel@lists.sourceforge.net>
Subject: [matplotlib-devel] Visual Studio 6 Compiler Error

Hey all,
     So after getting the Visual Studio 7.1/Python 2.4 build working,
I am trying to get Visual Studio 6/Python2.3 working. I could use
some help on a crazy agg/c++ error I am getting. Basically the VS6
compiler is much pickier than VS7.1 I have corrected a few problems,
but I am stuck on this one:

building 'matplotlib.backends._na_backend_agg' extension
C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo
/Ox /MD /W3 /GX /DNDEBUG -Iwin32_static\include -I. -Isrc -Iswig
-Iagg23/include -I. -Iwin32 _static\include -I.
-Iwin32_static\include\freetype2 -I.\freetype2 -Isrc\freetype2
-Iswig\freetype2 -Iagg23/include\freetype2 -I.\freetype2
-Iwin32_static\include\freetype2 -I.\freetype2 -Ic:\Python23\include
-Ic:\Python23\PC /Tpsrc/_na_backend_agg.cpp
Fobuild\temp.win32-2.3\Release\src/_na_backend_agg.obj -DNUMARRAY=3D1
_na_backend_agg.cpp
src/_na_backend_agg.cpp(63) : warning C4800: 'long' : forcing value to
bool 'true' or 'false' (performance warning)
src/_na_backend_agg.cpp(337) : error C2893: Failed to specialize
function template 'void __thiscall RendererAgg::_fill_and_stroke(VS
&,const class GCAgg &,const struct std::pair<bool,struct agg::rgba>
&,bool)'
        With the following template arguments:
        'class agg::path_storage'
src/_na_backend_agg.cpp(362) : error C2893: Failed to specialize
function template 'void __thiscall RendererAgg::_fill_and_stroke(VS
&,const class GCAgg &,const
struct std::pair<bool,struct agg::rgba> &,bool)'
        With the following template arguments:
        'class agg::ellipse'
src/_na_backend_agg.cpp(411) : error C2893: Failed to specialize
function template 'void __thiscall RendererAgg::_fill_and_stroke(VS
&,const class GCAgg &,const
struct std::pair<bool,struct agg::rgba> &,bool)'
        With the following template arguments:
        'class agg::path_storage'
src/_na_backend_agg.cpp(1813) : error C2893: Failed to specialize
function template 'void __thiscall RendererAgg::_fill_and_stroke(VS
&,const class GCAgg &,cons
t struct std::pair<bool,struct agg::rgba> &,bool)'
        With the following template arguments:
        'class agg::path_storage'
error: Command ""C:\Program Files\Microsoft Visual
Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG
-Iwin32_static\include -I. -Isrc -Iswig -Iagg23/include -I.
-Iwin32_static\include -I. -Iwin32_static\include\freetype2
-I.\freetype2 -Isrc\freetype2 -Iswig\freetype2
-Iagg23/include\freetype2 -I.\freetype2
-Iwin32_static\include\freetype2 -I.\freetype2 -Ic:\Python23\include
-Ic:\Python23 \PC /Tpsrc/_na_backend_agg.cpp
/Fobuild\temp.win32-2.3\Release\src/_na_backend_agg.obj -DNUMARRAY=3D1"
failed with exit status 2

Even though it says src/_na_backend_agg.cpp you should be looking at
the _backend_agg.cpp file. My only clue is that class
agg::path_storage does not conform to the VS class, but I don't know
how to fix this.

Thanks,
     Charlie

Just adding the "this->" didn't change anything, and the compiler
complains about the "< agg::ellipse >", which I don't quite
understand. I think the compiler is complaining more about the first
argument, since it is a template in the declaration. I am seeing more
online that basically says VS6 doesn't handle template very well.

Thanks,
     Charlie

···

On 4/13/06, James Evans <jrevans1@...310...> wrote:

Charlie,

I have had some experience with both versions of the MSVC++ compiler. The C++ compiler that
comes with VS6 is not as good at handling templates, but there are some tricks you can do to
force the compiler to do what you want.

A lot of times you can achieve this with more formal C++ (remember that the language
specification lets us take some shortcuts)

Try this on line #362:

this->_fill_and_stroke< agg::ellipse >( path, gc, face );

and do the appropriate similair reeplacement on the other lines. I no longer have VS6
installed on any machines that I have access to, so I cannot test this, but I believe that
this should work.