compile problems

Hi list,
I'm trying to make some test for modify and build the richtext
extension, but I find a lot of problems when I try to recreate the .py
and the .cpp with swig (I think). All the process seem to work, but when
I use the new extension created, I receive an error:

>>> import wx
>>> import wx.richtext
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/richtext.py", line 578, in ?
     class wxRichTextCtrl(_windows.wxScrolledWindow):
AttributeError: 'module' object has no attribute 'wxScrolledWindow'

also if I try to compile the richtext.i without modifications, so I
think that this is a compile/generating problem. So what are the right
commands to do for compile wxpyhon?

Thanks!
Michele

My commands are

#goto dir
cd /opt/wxwidgets2.8-2.8.0.1/wxPython

#Remove the last files
rm -rfv build-gtk2.unicode/temp.linux-i686-2.4/src/gtk/*rich* wx/*ric* src/gtk/rich*

#Create with swig the files
swig -Isrc/ -python -c++ -outdir src/gtk/ src/richtext.i

#move that to the right place
mv src/richtext_wrap.cxx src/gtk/richtext_wrap.cpp

#say to python to build
python setup.py build_ext --inplace

#move the compiled files to the default python dir
rm -fv /usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/*ric*
cp -v /opt/wxwidgets2.8-2.8.0.1/wxPython/wx/*ric* /usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/

Michele Petrazzo wrote:

Hi list,
I'm trying to make some test for modify and build the richtext
extension, but I find a lot of problems when I try to recreate the .py
and the .cpp with swig (I think). All the process seem to work, but when
I use the new extension created, I receive an error:

>>> import wx
>>> import wx.richtext
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/richtext.py", line 578, in ?
    class wxRichTextCtrl(_windows.wxScrolledWindow):
AttributeError: 'module' object has no attribute 'wxScrolledWindow'

also if I try to compile the richtext.i without modifications, so I
think that this is a compile/generating problem. So what are the right
commands to do for compile wxpyhon?

1. Are you using swig 1.3.29 with my patches applied? See wxPython/SWIG/README.txt

2. You should just use setup.py to build and install the wxPython extension modules, including letting it run swig for you. See wxPython/docs/BUILD.txt

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

1. Are you using swig 1.3.29 with my patches applied? See wxPython/SWIG/README.txt

No, of course :slight_smile: Just downloaded and tomorrow will try.

2. You should just use setup.py to build and install the wxPython extension modules, including letting it run swig for you. See wxPython/docs/BUILD.txt

Here I can found all that I need, except (if can be a problem) that I
don't find how to build only one extensions, not all. A solution, like
can I see, is to remove the .o file from build directory. Is the right one?

Thanks!

Michele Petrazzo wrote:

Robin Dunn wrote:

1. Are you using swig 1.3.29 with my patches applied? See wxPython/SWIG/README.txt

No, of course :slight_smile: Just downloaded and tomorrow will try.

2. You should just use setup.py to build and install the wxPython extension modules, including letting it run swig for you. See wxPython/docs/BUILD.txt

Here I can found all that I need, except (if can be a problem) that I
don't find how to build only one extensions, not all. A solution, like
can I see, is to remove the .o file from build directory. Is the right one?

That will do the compile, but not run swig. There is however some dependency checking going on, so if you modify the .i file then it will automatically know that it needs to run swig on that file and then compile the .cpp file it produces.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!