I'm forward this messages because when I answer to James I didn't notice
that I answer directly to him. Than he, didn't notice too, reply
directly to me.
···
--------------------------------------------------------------------------
On 6/20/05, Ricardo Pedroso <ricardo.pedroso@netvisao.pt> wrote:
Dom, 2005-06-19 às 15:14 -0400, James Carroll escreveu:
> Does anyone have an example I could follow? I want to do it in my
> source directory without putting things in the wxWidgets contribs as
> is described here:A good example is the wxpython config.py and setup.py that you can found
in the wxPython source directory.Ricardo
Thanks Ricardo,
I'm trying to use the wx.build.config method (like the wxPython
setup.py) to compile my extension. It seems like I'm getting
somewhere. I'm on XP have a fresh wxPython on a fresh Python 241, and
am pointing my include directories to Robin's development files that I
also downloaded today.
SWIG seems like it's working fine, but I'm getting compiler errors
having to do with wxCharBuffer not existing when buffer.h is included.
Does anyone use the distutils config.py for their own wxPython
extensions? If so, would you be willing to post a working example?
Below are my compiler errors and my setup.py
Thanks,
-Jim
-------------------------------------------------------------------
C:\jimc\prj\bright\builds\brightlib>python setup.py build
Building the Bright Library with Python Extensions...
running build
running build_ext
building '_bright' extension
swigging ../../src/imaging/big/TiledImageSource.i to ../../src/imaging/big/Tiled
ImageSource_wrap.c
c:\apps\shop\swig.exe -python -o ../../src/imaging/big/TiledImageSource_wrap.c .
./../src/imaging/big/TiledImageSource.i
..\..\src\imaging\big\TiledImageSource.i(29): Warning(301): class keyword used,
but not in C++ mode.
swigging ../../src/imaging/big/tiledTiffWriter.i to ../../src/imaging/big/tiledT
iffWriter_wrap.c
c:\apps\shop\swig.exe -python -o ../../src/imaging/big/tiledTiffWriter_wrap.c ..
/../src/imaging/big/tiledTiffWriter.i
..\..\src\imaging\big\tiledTiffWriter.i(29): Warning(301): class keyword used, b
ut not in C++ mode.
swigging ../../src/imaging/big/zoomifyReaderWx.i to ../../src/imaging/big/zoomif
yReaderWx_wrap.c
c:\apps\shop\swig.exe -python -o ../../src/imaging/big/zoomifyReaderWx_wrap.c ..
/../src/imaging/big/zoomifyReaderWx.i
..\..\src\imaging\big\zoomifyReaderWx.i(34): Warning(301): class keyword used, b
ut not in C++ mode.
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox
/MD /W3 /GX /DNDEBUG -I../../src/ -I../../libs/crypto521/ -I../../libs/wxPython
-2.6.1.0/include/ -I../../libs/wxPython-2.6.1.0/include/wx/msw/ -I../../libs/wxP
ython-2.6.1.0/include/tiff -I../../libs/wxPython-2.6.1.0/include/expat -I/usr/in
clude/python2.4/ -IC:\Python24\include -IC:\Python24\PC /Tc../../src/imaging/big
/TiledImageSource_wrap.c /Fobuild\temp.win32-2.4\Release\../../src/imaging/big/T
iledImageSource_wrap.obj
TiledImageSource_wrap.c
../../libs\wxPython-2.6.1.0\include\wx\buffer.h(96) : error C2061: syntax error
: identifier 'wxCharBuffer'
../../libs\wxPython-2.6.1.0\include\wx\buffer.h(96) : error C2059: syntax error
: ';'
../../libs\wxPython-2.6.1.0\include\wx\buffer.h(96) : error C2449: found '{' at
file scope (missing function header?)
../../libs\wxPython-2.6.1.0\include\wx\buffer.h(96) : error C2059: syntax error
: '}'
../../libs\wxPython-2.6.1.0\include\wx\buffer.h(96) : fatal error C1903: unable
to recover from previous error(s); stopping compilation
error: command '"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.e
xe"' failed with exit status 2
-------------------------------------------------------------------
# this imports what we need from distutils
# should work with wxPython 2.6 (and maybe a late 2.5)
import sys, os
sys.setup_is_main = __name__ == "__main__" # an icky hack!
from wx.build.config import *
library = '_bright'
sourceDir = '../../src/'
sourceFiles = [
'imaging/imageColorFilter.cpp',
'imaging/big/TiledImageSource.i',
'imaging/big/tiledTiffWriter.cpp',
'imaging/big/tiledTiffWriter.i',
'imaging/big/zoomifyReaderWx.cpp',
'imaging/big/zoomifyReaderWx.i',
]
sources = ["%s%s" % (sourceDir, src) for src in sourceFiles]
includeDirs = [
'../../src/',
'../../libs/wxPython-2.6.1.0/include/',
'../../libs/wxPython-2.6.1.0/include/wx/msw/',
'../../libs/wxPython-2.6.1.0/include/tiff',
'../../libs/wxPython-2.6.1.0/include/expat',
]
usual_libs = """
'../../libs/wx26x/',
'../../libs/wx26x/msw',
'../../libs/wx26x/tiff',
'../../libs/wx26x/expat',
"""
msg('Building the Bright Library with Python Extensions...')
ext = Extension('_bright', sources,
include_dirs = includeDirs)
setup (name='vsEdit', version='0.1',
description='Large File editor',
ext_modules=[ext])