Mads Lindstrøm | 14 Sep 23:45 2007
Picon

WxHaskell do not compile on WxGTK

Hi all

I get the following error, when compiling the Darcs version of WxHaskell
(wxgtk-2.6.3 backend):

wxc/src/ewxw/eljcursor.cpp: In function 'void* Cursor_CreateLoad(const wxString*, long int, int, int)':
wxc/src/ewxw/eljcursor.cpp:18: error: no matching function for call to 'wxCursor::wxCursor(const
wxString&, long int&, int&, int&)'
/usr/include/wx-2.6/wx/gtk/cursor.h:42: note: candidates are: wxCursor::wxCursor(const char*,
int, int, int, int, const char*, wxColour*, wxColour*)
/usr/include/wx-2.6/wx/gtk/cursor.h:38: note:                 wxCursor::wxCursor(const wxImage&)
/usr/include/wx-2.6/wx/gtk/cursor.h:36: note:                 wxCursor::wxCursor(const wxCursor&)
/usr/include/wx-2.6/wx/gtk/cursor.h:35: note:                 wxCursor::wxCursor(int)
/usr/include/wx-2.6/wx/gtk/cursor.h:34: note:                 wxCursor::wxCursor()

It is due to WxGTK lacking the wxCursor constructor (const wxString*,
long int, int, int) - see
http://thread.gmane.org/gmane.comp.lib.wxwidgets.general/45999 .

Would it be possible to remove the dependency on this wxCursor
constructor, so that the WxGTK version will compile?

If not, do anybody have suggestions of how to fix the problem?

Greetings,

Mads Lindstrøm
	

-------------------------------------------------------------------------
(Continue reading)

Mads Lindstrøm | 15 Sep 17:42 2007
Picon

Re: WxHaskell do not compile on WxGTK

Hi all

I tried putting "#ifndef __WXGTK__" around references to
Cursor_CreateLoad before doing configure, make, ... I created the
#ifndef in the file /wxc/include/ewxw/wxc_glue.h and in the
file /wxc/src/ewxw/eljcursor.cpp.

But the Cursor_CreateLoad function still gets automatically created in
the file
wxcore/src/Graphics/UI/WXCore/WxcClassesAL.hs . It seems that the
"#ifndef __WXGTK__" is simply ignored by the command
out/wxdirect/wxdirect . Is this correct?

If it is correct, how should I then make conditional compilation?

Greetings,

Mads Lindstrøm

> Hi all
> 
> I get the following error, when compiling the Darcs version of WxHaskell
> (wxgtk-2.6.3 backend):
> 
> wxc/src/ewxw/eljcursor.cpp: In function 'void* Cursor_CreateLoad(const wxString*, long int, int, int)':
> wxc/src/ewxw/eljcursor.cpp:18: error: no matching function for call to 'wxCursor::wxCursor(const
wxString&, long int&, int&, int&)'
> /usr/include/wx-2.6/wx/gtk/cursor.h:42: note: candidates are: wxCursor::wxCursor(const char*,
int, int, int, int, const char*, wxColour*, wxColour*)
> /usr/include/wx-2.6/wx/gtk/cursor.h:38: note:                 wxCursor::wxCursor(const wxImage&)
(Continue reading)

shelarcy | 16 Sep 06:28 2007
Picon

Re: WxHaskell do not compile on WxGTK

Hi Mads,

On Sun, 16 Sep 2007 00:42:17 +0900, Mads Lindstrøm <mads_lindstroem <at> yahoo.dk> wrote:
> I tried putting "#ifndef __WXGTK__" around references to
> Cursor_CreateLoad before doing configure, make, ... I created the
> #ifndef in the file /wxc/include/ewxw/wxc_glue.h and in the
> file /wxc/src/ewxw/eljcursor.cpp.

cursorCreateFromFile requires wxc's Cursor_CreateFromImage functions.
http://darcs.haskell.org/wxhaskell/wxcore/src/Graphics/UI/WXCore/Image.hs

And wxhaskell doesn't have statically information now.
http://www.mail-archive.com/wxhaskell-users <at> lists.sourceforge.net/msg00196.html

So I think below change is better than hiding functions and references.

EWXWEXPORT(void*, Cursor_CreateFromImage)(wxImage* image)
{
#ifndef __WXGTK__
	return (void*) new wxCursor(*image);
#else
   return NULL;
#endif
}

This solution is usually used when wxc requires compilation flag.
http://darcs.haskell.org/wxhaskell/wxc/src/glcanvas.cpp

> But the Cursor_CreateLoad function still gets automatically created in
> the file
(Continue reading)

shelarcy | 16 Sep 06:45 2007
Picon

Re: WxHaskell do not compile on WxGTK

Oops, I misread your mail.
So I want to send correct one.

EWXWEXPORT(void*, Cursor_CreateLoad) (const wxString* name, long type, int width, int height)
{
#ifndef __WXGTK__
     return (void*) new wxCursor(*name, type, width, height);
#else
     return NULL;
#endif
}

Best Regards,

On Sun, 16 Sep 2007 00:42:17 +0900, Mads Lindstrøm <mads_lindstroem <at> yahoo.dk> wrote:
>> I get the following error, when compiling the Darcs version of WxHaskell
>> (wxgtk-2.6.3 backend):
>>
>> wxc/src/ewxw/eljcursor.cpp: In function 'void* Cursor_CreateLoad(const wxString*, long int, int, int)':
>> wxc/src/ewxw/eljcursor.cpp:18: error: no matching function for call to 'wxCursor::wxCursor(const
wxString&, long int&, int&, int&)'
>> /usr/include/wx-2.6/wx/gtk/cursor.h:42: note: candidates are: wxCursor::wxCursor(const char*,
int, int, int, int, const char*, wxColour*, wxColour*)
>> /usr/include/wx-2.6/wx/gtk/cursor.h:38: note:                 wxCursor::wxCursor(const wxImage&)
>> /usr/include/wx-2.6/wx/gtk/cursor.h:36: note:                 wxCursor::wxCursor(const wxCursor&)
>> /usr/include/wx-2.6/wx/gtk/cursor.h:35: note:                 wxCursor::wxCursor(int)
>> /usr/include/wx-2.6/wx/gtk/cursor.h:34: note:                 wxCursor::wxCursor()
>>
>> It is due to WxGTK lacking the wxCursor constructor (const wxString*,
>> long int, int, int) - see
(Continue reading)


Gmane