Hi,

This appears to be specific to 32 bit VC7 + whatever Platform SDK you have installed.

I don't have 32 bit VC7 - but 64 bit VC7 and 32 bit VC6 seem to have no problem resolving these overloads. (and gcc has no problem on a variety of platforms).

The param has been a wxBitmapType in the Wx source since Oct 2009.

Anyhow, you have located the issue for your own setup so simply changing line 32 of XS/cursor.xs

-- wxBitmapType type
++ long type

should allow you to compile.

I suppose there would be no harm in reverting the argument type in Wx source for wxWidgets < 2.9.0

Regards

Mark

On 12/06/2011 16:27, Patcat88 wrote:
Trying to compile WxPerl 0.9901 with wxMSW-2.8.12 and
Alien-wxWidgets-0.52 on Perl 5.10.0 on Windows XP with Visual Studio
2003, I error out when running 'nmake'. How can I get WxPerl to compile?

=============================================================
C:\Perl\bin\perl.exe C:\Perl\site\lib\ExtUtils\xsubpp -nolinenumbers -n
oprototypes -typemap C:\Perl\lib\ExtUtils\typemap -typemap typemap
Event.xs >
Event.xsc && C:\Perl\bin\perl.exe -MExtUtils::Command -e "mv" --
Event.xsc Event
.c
cl -GF -TP /c /nologo /TP /MD /Zi /Od /W4 /GR /EHsc -c -I. -I. -IC:\Pe
rl\site\lib\Alien\wxWidgets\msw_2_8_12_dbg_cl_7_1\lib
-IC:\Perl\site\lib\Alien\w
xWidgets\msw_2_8_12_dbg_cl_7_1\include -nologo -GF -W3 -MD -Zi -DNDEBUG
-O1 -DW
IN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE
-DPRIVLIB_LAST
_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO
-DPERL_MSVCRT_R
EADFIX -DVERSION=\"0.9901\" -DXS_VERSION=\"0.9901\" "-IC:\Perl\lib\CORE"
-DWIN32 -D__NO_VC_CRTDBG__ -D__WXMSW__ -D__WXDEBUG__ -DNDEBUG
-DWXUSINGDLL -D_WI
NDOWS -DNOPCH -D_CRT_SECURE_NO_DEPRECATE Event.c
cl : Command line warning D4025 : overriding '/W4' with '/W3'
cl : Command line warning D4025 : overriding '/Od' with '/O1'
Event.c
C:\Perl\bin\perl.exe C:\Perl\site\lib\ExtUtils\xsubpp -nolinenumbers -n
oprototypes -typemap C:\Perl\lib\ExtUtils\typemap -typemap typemap
Frames.xs >
Frames.xsc && C:\Perl\bin\perl.exe -MExtUtils::Command -e "mv" --
Frames.xsc Fr
ames.c
cl -GF -TP /c /nologo /TP /MD /Zi /Od /W4 /GR /EHsc -c -I. -I. -IC:\Pe
rl\site\lib\Alien\wxWidgets\msw_2_8_12_dbg_cl_7_1\lib
-IC:\Perl\site\lib\Alien\w
xWidgets\msw_2_8_12_dbg_cl_7_1\include -nologo -GF -W3 -MD -Zi -DNDEBUG
-O1 -DW
IN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE
-DPRIVLIB_LAST
_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO
-DPERL_MSVCRT_R
EADFIX -DVERSION=\"0.9901\" -DXS_VERSION=\"0.9901\" "-IC:\Perl\lib\CORE"
-DWIN32 -D__NO_VC_CRTDBG__ -D__WXMSW__ -D__WXDEBUG__ -DNDEBUG
-DWXUSINGDLL -D_WI
NDOWS -DNOPCH -D_CRT_SECURE_NO_DEPRECATE Frames.c
cl : Command line warning D4025 : overriding '/W4' with '/W3'
cl : Command line warning D4025 : overriding '/Od' with '/O1'
Frames.c
C:\Perl\bin\perl.exe C:\Perl\site\lib\ExtUtils\xsubpp -nolinenumbers -n
oprototypes -typemap C:\Perl\lib\ExtUtils\typemap -typemap typemap
GDI.xs > GD
I.xsc && C:\Perl\bin\perl.exe -MExtUtils::Command -e "mv" -- GDI.xsc GDI.c
cl -GF -TP /c /nologo /TP /MD /Zi /Od /W4 /GR /EHsc -c -I. -I. -IC:\Pe
rl\site\lib\Alien\wxWidgets\msw_2_8_12_dbg_cl_7_1\lib
-IC:\Perl\site\lib\Alien\w
xWidgets\msw_2_8_12_dbg_cl_7_1\include -nologo -GF -W3 -MD -Zi -DNDEBUG
-O1 -DW
IN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE
-DPRIVLIB_LAST
_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO
-DPERL_MSVCRT_R
EADFIX -DVERSION=\"0.9901\" -DXS_VERSION=\"0.9901\" "-IC:\Perl\lib\CORE"
-DWIN32 -D__NO_VC_CRTDBG__ -D__WXMSW__ -D__WXDEBUG__ -DNDEBUG
-DWXUSINGDLL -D_WI
NDOWS -DNOPCH -D_CRT_SECURE_NO_DEPRECATE GDI.c
cl : Command line warning D4025 : overriding '/W4' with '/W3'
cl : Command line warning D4025 : overriding '/Od' with '/O1'
GDI.c
GDI.c(4783) : warning C4996: 'wxDCBase::BeginDrawing' was declared
deprecated
C:\Perl\site\lib\Alien\wxWidgets\msw_2_8_12_dbg_cl_7_1\include\wx\dc.h(3
92) : see declaration of 'wxDCBase::BeginDrawing'
GDI.c(5554) : warning C4996: 'wxDCBase::EndDrawing' was declared deprecated
C:\Perl\site\lib\Alien\wxWidgets\msw_2_8_12_dbg_cl_7_1\include\wx\dc.h(3
93) : see declaration of 'wxDCBase::EndDrawing'
GDI.c(8609) : error C2666: 'wxCursor::wxCursor' : 2 overloads have
similar conve
rsions
C:\Perl\site\lib\Alien\wxWidgets\msw_2_8_12_dbg_cl_7_1\include\wx\msw\cu
rsor.h(29): could be 'wxCursor::wxCursor(const wxString &,long,int,int)'
C:\Perl\site\lib\Alien\wxWidgets\msw_2_8_12_dbg_cl_7_1\include\wx\msw\cu
rsor.h(26): or 'wxCursor::wxCursor(const char [],int,int,int,int,const cha
r [])'
while trying to match the argument list '(wxString, wxBitmapType, int, i
nt)'
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

C:\sources\Wx-0.9901>
=====================================================================

Looking through the source code, I think the error is related to
Wx-0.9901\XS\Cursor.xs, the definition of newFile in the Cursor.xs is

===========================================================
#if defined( __WXMSW__ ) || defined( __WXPERL_FORCE__ )

wxCursor*
newFile( CLASS, name, type, hsx = -1, hsy = -1 )
SV* CLASS
wxString name
wxBitmapType type
int hsx
int hsy
CODE:
RETVAL = new wxCursor( name, type, hsx, hsy );
OUTPUT:
RETVAL

#endif

=============================================================
wxCursor has a few constructors,
=============================================================

// Cursor
class WXDLLEXPORT wxCursor : public wxGDIImage
{
public:
// constructors
wxCursor();
wxCursor(const wxImage& image);
wxCursor(const char bits[], int width, int height,
int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL);
wxCursor(const wxString& name,
long flags = wxBITMAP_TYPE_CUR_RESOURCE,
int hotSpotX = 0, int hotSpotY = 0);
wxCursor(int idCursor);
virtual ~wxCursor();
=============================================================
Wx-0.9901\XS\Cursor.xs winds up in Wx-0.9901\GDI.xs through an xsubpp
"INCLUDE:"

newFile in GDI.c looks like
=============================================================

#if defined( __WXMSW__ ) || defined( __WXPERL_FORCE__ )
#define XSubPPtmpAACG 1


XS(XS_Wx__Cursor_newFile); /* prototype to pass -Wmissing-prototypes */
XS(XS_Wx__Cursor_newFile)
{
#ifdef dVAR
dVAR; dXSARGS;
#else
dXSARGS;
#endif
if (items < 3 || items > 5)
croak_xs_usage(cv, "CLASS, name, type, hsx = -1, hsy = -1");
{
SV* CLASS = ST(0);
wxString name;
wxBitmapType type = (wxBitmapType)SvIV(ST(2));
int hsx;
int hsy;
wxCursor * RETVAL;

WXSTRING_INPUT( name, wxString, ST(1) );

if (items < 4)
hsx = -1;
else {
hsx = (int)SvIV(ST(3));
}

if (items < 5)
hsy = -1;
else {
hsy = (int)SvIV(ST(4));
}
RETVAL = new wxCursor( name, type, hsx, hsy );
ST(0) = sv_newmortal();
wxPli_object_2_sv( aTHX_ ST(0), RETVAL );
wxPli_thread_sv_register( aTHX_ "Wx::Cursor", RETVAL, ST(0) );

}
XSRETURN(1);
}

#endif
=============================================================


So, Cursor.XS is creating a wxBitmapType and passing that, but
wxCursor() wants a long.

Reply via email to