From: Vivian M. <has...@gm...> - 2014-08-31 04:48:23
|
Hi, I defined in "plot.cc": #include <gdk/gdk.h> #include <wx/wx.h> extern "C" { GdkWindow* gdk_get_drawable(wxPaintDC* dc) { return dc->GetGDKWindow(); } } And then in my haskell source Plot.hs: #else foreign import ccall unsafe "plot.cc gdk_get_drawable" c_gdkGetDrawable :: DC a -> IO Gtk.DrawWindow #endif Which results in these errors: [1 of 2] Compiling Graphics.UI.WX.Plot ( lib/Graphics/UI/WX/Plot.hs, dist/build/Graphics/UI/WX/Plot.o ) lib/Graphics/UI/WX/Plot.hs:151:1: Unacceptable argument type in foreign declaration: Object (CWxObject (CDC a)) When checking declaration: foreign import ccall unsafe "static plot.cc gdk_get_drawable" c_gdkGetDrawable :: DC a -> IO Gtk.DrawWindow lib/Graphics/UI/WX/Plot.hs:151:1: Unacceptable result type in foreign declaration: IO Gtk.DrawWindow When checking declaration: foreign import ccall unsafe "static plot.cc gdk_get_drawable" c_gdkGetDrawable :: DC a -> IO Gtk.DrawWindow How do I fix these errors? Thanks, Vivian |