wxPython build trouble

I am having trouble getting wxPython to install properly on my x86_64
fedora linux box. When I run "python setup.py build_ext --inplace --
debug UNICODE=0", I see the output/errors below. Does anyone know how
to fix the install problems?

Thanks.
Mike

WARNING: WXWIN not set in environment. Assuming '..'
Found wx-config: /usr/local/bin/wx-config
    Using flags: --toolkit=gtk2 --unicode=no --version=2.8
Preparing CORE...
Preparing GLCANVAS...
Preparing STC...
Preparing GIZMOS...
running build_ext
building '_gdi_' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -
Wstrict-prototypes -fPIC -g -DSWIG_TYPE_TABLE=_wxPython_table -
DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/
usr/local/lib/wx/include/gtk2-ansi-release-2.8 -I/usr/local/include/
wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/
include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/
include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/local/include/
python2.6 -c src/gtk/_gdi_wrap.cpp -o build-gtk2/temp.linux-x86_64-2.6/
src/gtk/_gdi_wrap.o -pthread -g -O0
cc1plus: warning: command line option "-Wstrict-prototypes" is valid
for Ada/C/ObjC but not for C++
src/gtk/_gdi_wrap.cpp: In constructor ‘swig::PyObject_ptr::PyObject_ptr
(PyObject*, bool)’:
src/gtk/_gdi_wrap.cpp:2695: warning: suggest explicit braces to avoid
ambiguous ‘else’
In file included from src/gtk/_gdi_wrap.cpp:2738:
include/wx/wxPython/wxPython.h: In function ‘bool wxPyCoreAPI_IMPORT
()’:
include/wx/wxPython/wxPython.h:39: warning: deprecated conversion from
string constant to ‘char*’
include/wx/wxPython/wxPython.h:39: warning: deprecated conversion from
string constant to ‘char*’
src/gtk/_gdi_wrap.cpp: In function ‘wxPalette* new_wxPalette(const
wxArrayInt&, const wxArrayInt&, const wxArrayInt&)’:
src/gtk/_gdi_wrap.cpp:2885: warning: comparison between signed and
unsigned integer expressions
src/gtk/_gdi_wrap.cpp:2885: warning: comparison between signed and
unsigned integer expressions
src/gtk/_gdi_wrap.cpp: In member function ‘virtual bool
wxGraphicsContext::SetLogicalFunction(int)’:
src/gtk/_gdi_wrap.cpp:4115: warning: no return statement in function
returning non-void
src/gtk/_gdi_wrap.cpp: In function ‘PyObject*
_wrap_DC_SetDeviceClippingRegion(PyObject*, PyObject*, PyObject*)’:
src/gtk/_gdi_wrap.cpp:20612: error: ‘class wxDC’ has no member named
‘SetDeviceClippingRegion’
src/gtk/_gdi_wrap.cpp: In function ‘PyObject*
_wrap_GraphicsRenderer_CreateBitmap(PyObject*, PyObject*, PyObject*)’:
src/gtk/_gdi_wrap.cpp:31407: error: ‘class wxGraphicsRenderer’ has no
member named ‘CreateBitmap’
src/gtk/_gdi_wrap.cpp: In function ‘PyObject* _wrap_PenList_AddPen
(PyObject*, PyObject*, PyObject*)’:
src/gtk/_gdi_wrap.cpp:33057: warning: ‘void wxPenList::AddPen(wxPen*)’
is deprecated (declared at /usr/local/include/wx-2.8/wx/gdicmn.h:516)
src/gtk/_gdi_wrap.cpp: In function ‘PyObject* _wrap_PenList_RemovePen
(PyObject*, PyObject*, PyObject*)’:
src/gtk/_gdi_wrap.cpp:33095: warning: ‘void wxPenList::RemovePen
(wxPen*)’ is deprecated (declared at /usr/local/include/wx-2.8/wx/
gdicmn.h:517)
src/gtk/_gdi_wrap.cpp: In function ‘PyObject* _wrap_BrushList_AddBrush
(PyObject*, PyObject*, PyObject*)’:
src/gtk/_gdi_wrap.cpp:33188: warning: ‘void wxBrushList::AddBrush
(wxBrush*)’ is deprecated (declared at /usr/local/include/wx-2.8/wx/
gdicmn.h:526)
src/gtk/_gdi_wrap.cpp: In function ‘PyObject*
_wrap_BrushList_RemoveBrush(PyObject*, PyObject*, PyObject*)’:
src/gtk/_gdi_wrap.cpp:33226: warning: ‘void wxBrushList::RemoveBrush
(wxBrush*)’ is deprecated (declared at /usr/local/include/wx-2.8/wx/
gdicmn.h:527)
src/gtk/_gdi_wrap.cpp: In function ‘PyObject* _wrap_FontList_AddFont
(PyObject*, PyObject*, PyObject*)’:
src/gtk/_gdi_wrap.cpp:33378: warning: ‘void wxFontList::AddFont
(wxFont*)’ is deprecated (declared at /usr/local/include/wx-2.8/wx/
gdicmn.h:539)
src/gtk/_gdi_wrap.cpp: In function ‘PyObject* _wrap_FontList_RemoveFont
(PyObject*, PyObject*, PyObject*)’:
src/gtk/_gdi_wrap.cpp:33416: warning: ‘void wxFontList::RemoveFont
(wxFont*)’ is deprecated (declared at /usr/local/include/wx-2.8/wx/
gdicmn.h:540)
error: command 'gcc' failed with exit status 1

snaps wrote:

I am having trouble getting wxPython to install properly on my x86_64
fedora linux box. When I run "python setup.py build_ext --inplace --
debug UNICODE=0", I see the output/errors below. Does anyone know how
to fix the install problems?

My guess is that you are using an older version of wxWidgets than your wxPython version.

···

--
Robin Dunn
Software Craftsman

Hi Robin,

I am using wxPython version 2.8.10.1 with wxWidget 2.8.10 with python version 2.6.2. If I look inside the “_gdi_wrap.cpp” file, I do not see a function called “CreateBitmap” in the “wxGraphicsBitmap” class (as indicated by the errors below). Furthermore, I notice the include guards in the file “/usr/local/include/wx-2.8/wx/graphics.h”. Please advise on how to continue.

Thanks.
Mike

----------------- include guards in graphics.h --------------------
#if wxABI_VERSION >= 20809
wxGraphicsBitmap CreateBitmap( const wxBitmap &bmp );
#endif

------------------- compilation errors --------------------------
src/gtk/_gdi_wrap.cpp: In function ‘PyObject* _wrap_DC_SetDeviceClippingRegion(PyObject*, PyObject*, PyObject*)’:
src/gtk/_gdi_wrap.cpp:20612: error: ‘class wxDC’ has no member named ‘SetDeviceClippingRegion’
src/gtk/_gdi_wrap.cpp: In function ‘PyObject* _wrap_GraphicsRenderer_CreateBitmap(PyObject*, PyObject*, PyObject*)’:
src/gtk/_gdi_wrap.cpp:31407: error: ‘class wxGraphicsRenderer’ has no member named ‘CreateBitmap’

···

On Thu, Jun 4, 2009 at 12:31 AM, Robin Dunn robin@alldunn.com wrote:

snaps wrote:

I am having trouble getting wxPython to install properly on my x86_64

fedora linux box. When I run "python setup.py build_ext --inplace –

debug UNICODE=0", I see the output/errors below. Does anyone know how

to fix the install problems?

My guess is that you are using an older version of wxWidgets than your

wxPython version.

Robin Dunn

Software Craftsman

http://wxPython.org

Mike Thornton wrote:

Hi Robin,

I am using wxPython version 2.8.10.1 with wxWidget 2.8.10 with python version 2.6.2. If I look inside the "_gdi_wrap.cpp" file, I do *not* see a function called "CreateBitmap" in the "wxGraphicsBitmap" class (as indicated by the errors below). Furthermore, I notice the include guards in the file "/usr/local/include/wx-2.8/wx/graphics.h". Please advise on how to continue.

Thanks.
Mike

----------------- include guards in graphics.h --------------------
#if wxABI_VERSION >= 20809
    wxGraphicsBitmap CreateBitmap( const wxBitmap &bmp );
#endif

Do you have the headers for any other version of wxWidgets on your system that it might be finding by accident? If you're using the 2.8.10 headers then wxABI_VERSION should be 20810 so it should be seeing that method prototype.

···

--
Robin Dunn
Software Craftsman

I also ran into this problem trying to build 2.8.10.1 on both Solaris
9 x86
and RedHat 4. I think the issue is that the wxGraphicsRenderer C++
stub
class in _gdi_wrap.cpp does not have a stub for CreateBitmap, and for
whatever reason my build/configuration does not have
wxUSE_GRAPHICS_CONTEXT
set, so it uses the stub in _gdi_wrap.cpp and I get the error.

I see wxGraphicsContext does have a stub for CreateBitmap -- so maybe
coping that into wxGraphicsRender (in _gdi_wrap.cpp) will take care
of the problem. I will give that a try tomorrow.

I am curious as to why my wxPython build isn't setting
wxUSE_GRAPHICS_CONTEXT.
Looks like my wxWidgets build has it enabled (from config.log):

wx_cv_use_graphics_ctx=wxUSE_GRAPHICS_CONTEXT=yes

Do I need to configure that explicitly for my wxPython build somehow?

Thanks!

Joe

···

On Jun 4, 11:48 am, Robin Dunn <ro...@alldunn.com> wrote:

Mike Thornton wrote:
> Hi Robin,

> I am using wxPython version 2.8.10.1 with wxWidget 2.8.10 with python
> version 2.6.2. If I look inside the "_gdi_wrap.cpp" file, I do *not*
> see a function called "CreateBitmap" in the "wxGraphicsBitmap" class (as
> indicated by the errors below). Furthermore, I notice the include
> guards in the file "/usr/local/include/wx-2.8/wx/graphics.h". Please
> advise on how to continue.

> Thanks.
> Mike

> ----------------- include guards in graphics.h --------------------
> #if wxABI_VERSION >= 20809
> wxGraphicsBitmap CreateBitmap( const wxBitmap &bmp );
> #endif

Do you have the headers for any other version of wxWidgets on your
system that it might be finding by accident? If you're using the 2.8.10
headers then wxABI_VERSION should be 20810 so it should be seeing that
method prototype.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

Joe wrote:

I also ran into this problem trying to build 2.8.10.1 on both Solaris
9 x86
and RedHat 4. I think the issue is that the wxGraphicsRenderer C++
stub
class in _gdi_wrap.cpp does not have a stub for CreateBitmap, and for
whatever reason my build/configuration does not have
wxUSE_GRAPHICS_CONTEXT
set, so it uses the stub in _gdi_wrap.cpp and I get the error.

Ah, good catch. I didn't think about checking the stub version.

I see wxGraphicsContext does have a stub for CreateBitmap -- so maybe
coping that into wxGraphicsRender (in _gdi_wrap.cpp) will take care
of the problem. I will give that a try tomorrow.

I am curious as to why my wxPython build isn't setting
wxUSE_GRAPHICS_CONTEXT.
Looks like my wxWidgets build has it enabled (from config.log):

wx_cv_use_graphics_ctx=wxUSE_GRAPHICS_CONTEXT=yes

Do I need to configure that explicitly for my wxPython build somehow?

Configure will override the setting it if it is unable to find the libs and headers for Cairo. Check the output of configure or its log file to be sure.

···

--
Robin Dunn
Software Craftsman

Joe wrote:

> I see wxGraphicsContext does have a stub for CreateBitmap -- so maybe
> coping that into wxGraphicsRender (in _gdi_wrap.cpp) will take care
> of the problem. I will give that a try tomorrow.

I ran into the same issue trying to build 2.8.10.1 on Solaris, and I
can confirm that copying the CreateBitmap stub from
wxGraphicsRenderer to wxGraphicsContext in _gdi_wrap.cpp solves the
problem.

For clarity, I think A Brett meant "copying the CreateBitmap stub from
wxGraphicsContext to wxGraphicsRenderer."

Here's the patch I used against the 2.8.10.1 tarball sources to
accomplish the same.

jaraco@wilbur:~/projects/wxPython-src-2.8.10.1/wxPython/src/gtk$ diff -
crB _gdi_wrap.cpp.orig _gdi_wrap.cpp
*** _gdi_wrap.cpp.orig 2009-06-16 11:40:19.000000000 -0400
--- _gdi_wrap.cpp 2009-06-16 11:41:35.000000000 -0400

···

***************
*** 4195,4200 ****
--- 4195,4202 ----
      virtual wxGraphicsBrush CreateRadialGradientBrush(wxDouble ,
wxDouble , wxDouble , wxDouble , wxDouble ,
                                                        const wxColour
&, const wxColour &) { return wxNullGraphicsBrush; }
      virtual wxGraphicsFont CreateFont( const wxFont & , const
wxColour & ) { return wxNullGraphicsFont; }
+
+ wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) const
{ return wxNullGraphicsBitmap; }
  };

On Jun 12, 9:46 am, A Brett <alysbr...@googlemail.com> wrote:

> Joe wrote:
> > I see wxGraphicsContext does have a stub for CreateBitmap -- so maybe
> > coping that into wxGraphicsRender (in _gdi_wrap.cpp) will take care
> > of the problem. I will give that a try tomorrow.

I ran into the same issue trying to build 2.8.10.1 on Solaris, and I
can confirm that copying the CreateBitmap stub from
wxGraphicsRenderer to wxGraphicsContext in _gdi_wrap.cpp solves the
problem.

I ran into exactly the same problem on Ubuntu 9.04, no other wx
[Python] headers installed.

The problem was solved by the suggested patch. Here is yet another
downloadable version of it:
http://code.google.com/p/devide/source/browse/trunk/johannes/patches/wxpython28101_gdiwrap.diff

···

On Jun 16, 11:44 am, "Jason R. Coombs" <jar...@jaraco.com> wrote:

For clarity, I think A Brett meant "copying the CreateBitmap stub from
wxGraphicsContext to wxGraphicsRenderer."

Here's the patch I used against the 2.8.10.1 tarball sources to
accomplish the same.

jaraco@wilbur:~/projects/wxPython-src-2.8.10.1/wxPython/src/gtk$ diff -
crB _gdi_wrap.cpp.orig _gdi_wrap.cpp