[Pyrex] Once more, what's wrong here
Simon Burton
simon at arrowtheory.com
Thu Jan 15 01:29:43 CET 2004
This is what i get:
arrow:~/home/python/pyrex/sandpit$ pyrexc becker.pyx
arrow:~/home/python/pyrex/sandpit$ gcc -I. -I/usr/include/python2.2 -g -c becker.c
becker.c:62: field `__pyx_base' has incomplete type
becker.c:64: confused by earlier errors, bailing out
Are there other examples of this inheritance technique you are trying?
BTW It looks interesting (your code)..
Simon.
On Wed, 14 Jan 2004 22:06:07 +0000
Robin Becker <robin at reportlab.com> wrote:
> I asked before, but didn't get any reply.
>
> Can anyone say what's wrong here? I get the following when trying to
> compile the c output
>
> C:\code\reportlab\tex_wrap-1.00>xsetup.py build
> running build
> running build_ext
> building '_tex_wrap' extension
> C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox
> /MD /W3 /GX /DNDEBUG -IC:\Python\include -IC:\Py
> thon\PC /Tc_tex_wrap.c /Fobuild\temp.win32-2.3\Release\_tex_wrap.obj
> _tex_wrap.c
> _tex_wrap.c(62) : error C2079: '__pyx_base' uses undefined struct 'None'
> _tex_wrap.c(690) : error C2065: 'None' : undeclared identifier
> _tex_wrap.c(690) : error C2100: illegal indirection
> error: command '"C:\Program Files\Microsoft Visual
> Studio\VC98\BIN\cl.exe"' failed with exit status 2
>
>
> ############################################
> cdef class _Box:
> cdef readonly int penalty, flagged, is_glue, is_penalty, is_box
> cdef char* character
> cdef double width, stretch, shrink
>
> cdef class Box(_Box):
> """Class representing a glyph or character. Boxes have a fixed
> width that doesn't change.
> """
> def __init__(self, width, character):
> self.character = character
> self.width = width
> self.stretch = self.shrink = self.penalty = self.flagged =
> self.is_glue = self.is_penalty = 0
> self.is_box = 1
>
> cdef class Glue(_Box):
> """Class representing a bit of glue. Glue has a preferred width,
> but it can stretch up to an additional distance, and can shrink
> by a certain amount. Line breaks can be placed at any point where
> glue immediately follows a box.
> """
> def __init__(self, width, stretch, shrink):
> self.width = width
> self.stretch = stretch
> self.shrink = shrink
> self.is_glue = 1
> self.is_box = self.is_penalty = 0
>
> cdef compute_width(self):
> """Return how long this glue should be, for the given adjustment
> ratio r."""
> if r < 0: return self.width + r*self.shrink
> else: return self.width + r*self.stretch
> ###################################################
> --
> Robin Becker
>
> _______________________________________________
> Pyrex mailing list
> Pyrex at lists.copyleft.no
> http://lists.copyleft.no/mailman/listinfo/pyrex
--
Simon Burton, B.Sc.
Licensed PO Box A66
ANU Canberra 2601
Australia
Ph. 02 6249 6940
http://arrowtheory.com
More information about the Pyrex
mailing list