Pyrex - undefined struct/union

Haris Bogdanovic haris.bogdanovic at zg.hinet.hr
Sun Apr 13 22:36:32 CEST 2003


I have a problem with this piece of code :

cdef extern from "portaudio.h":
    struct PaDeviceInfo:
        int structVersion
        char *name
        int maxInputChannels
        int maxOutputChannels
        int numSampleRates
        double *sampleRates
        PaSampleFormat nativeSampleFormats

def GetDeviceInfo(device):
    cdef PaDeviceInfo *info
    info=Pa_GetDeviceInfo(device)

    for i from 0 <= i < info.numSampleRates:
        sampleRates[i]=info.sampleRates[i]

    return dict([('structVersion',info.structVersion),
                       ('name',info.name),
                       ('maxInputChannels',info.maxInputChannels),
                       ('maxOutputChannels',info.maxOutputChannels),
                       ('numSampleRates',info.numSampleRates),
                       ('sampleRates',sampleRates),
                       ('nativeSampleFormats',info.nativeSampleFormats),
                       ('structVersion',info.structVersion)])

This part compiles successfully with pyrexc but when compiling C file
(generated by pyrexc) I get errors that left from all this "info" struct
members is an undefined struct/union.
What does that mean and how can I fix it ?

Thanks








More information about the Python-list mailing list