On Mon, Oct 11, 2010 at 10:43 PM, PrimeCenter <ch...@augmentedprime.com> wrote:
> Perhaps I should post to the pymssql board but I will try here first.
> Basically I am trying to get pymssql installed on a mac. It requires
> cython. There are numerous build errors associated with cython and I
> tried a simple one-liner to try and isolate the problem.
>
> File test.pyx contains:
> from stdlib cimport strlen
>
> I then run...
> cython -a test.pyx
>
> Here is the output:
> warning: /Users/blank/Downloads/pymssql-1.9.908/test.pyx:1:0: 'stdlib'
> is deprecated, use 'libc.stdlib'
I think you want:
from libc.string cimport strlen
Best,
Matthew
Well, you stripped the part of the original mail that said
from libc.string cimport strlen
Mind the "string" bit, named after string.h which defines it.
Stefan
I hope you sent them a patch!
>
> Hi,
>
> On Mon, Oct 11, 2010 at 10:43 PM, PrimeCenter <chris <at> augmentedprime.com>
Hi Matt,
I am getting the same error when compiling a.pyx file though I am correctly
importing from libc as under:
from libc.stdint cimport uint8_t, uint16_t, uint32_t, int8_t, int16_t, int32_t
from libc.stdlib cimport malloc,free
Errors that I get are as follows:
from libc.stdint cimport uint8_t, uint16_t, uint32_t, int8_t, int16_t, int32_t
^
------------------------------------------------------------
/home/me/test.pyx:6:0: 'uint8_t.pxd' not found
Error converting Pyrex file to C:
------------------------------------------------------------
...
# Wierd thing about cython: defines are hard to import so we have to track the
# sizes in two places
cdef int ETH_ALEN=6
cdef int PACKET_BUFFER = 2048
from libc.stdint cimport uint8_t, uint16_t, uint32_t, int8_t, int16_t, int32_t
^
------------------------------------------------------------
/home/me/test.pyx:6:25: Name 'uint8_t' not declared in module 'libc.stdint'
Any ideas??
The usual question at this point: what version of Cython are you using?
Look through the file Cython/Includes/libc/stdint.pxd to see if the
declaration is in there.
Stefan
BTW, does anyone know what this "defines are hard to import" is supposed to
mean? I can't remember a bug report about something like this...
Stefan
I think the OP just doesn't know about this trick:
cdef extern from "myheader.h":
cdef enum:
ETH_ALEN
Dag
The hard thing is exporting enums into python space.
--
vitja.