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=1
_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=1"
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

Charlie,

Some digging on the internet indicates that that VC++ 6 does not support template member functions that are defined outside of the class declaration[1] and is badly confused by template memeber functions that don't use the parameterized type in their arguments list[2].

I think that your current problem may be solved by moving the definintion of _fill_and_stroke() to within the declaration of RendererAgg in `backend_agg.h'. I don't have access to a Windows machine at this time, so I haven't been able to test this hunch myself.

Ken

P.S. Here's a nit for you: RendererAgg::_get_rgba_face() uses and returns a std::pair<bool, agg::rgba> instead of a facepair_t.

[1] C++ Templates FAQ, Question Four
http://womble.decadentplace.org.uk/c++/template-faq.html#vc6-non-inline-mem

[2] C++ Templates FAQ, Question Five
http://womble.decadentplace.org.uk/c++/template-faq.html#vc6-name-mangling-bug

Some digging on the internet indicates that that VC++ 6 does not support
template member functions that are defined outside of the class declaration[1]
and is badly confused by template memeber functions that don't use the
parameterized type in their arguments list[2].

I think that your current problem may be solved by moving the definintion of
_fill_and_stroke() to within the declaration of RendererAgg in
`backend_agg.h'. I don't have access to a Windows machine at this time, so I
haven't been able to test this hunch myself.

So this approach brought actually got me passed the error, BUT it
walked me straight into an internal compiler error with just a code
returned. I am thinking I will have to start looking into these open
source STL implementations. I'll work on it more tonight and write
back with what I find out. Did I mention my progression through major
programming languages never included C++. I do appreciate and really
need the help.

P.S. Here's a nit for you: RendererAgg::_get_rgba_face() uses and returns a
std::pair<bool, agg::rgba> instead of a facepair_t.

Yeah, that's weird that the header and implementation don't match up,
and yet no complaints from the compiler.

Thanks,
     Charlie