Hey,
right at the moment I am struggling with the same problems. The documentation of the cpdef enum is quite insufficient and the error from the compiler is also not of any interest.
I've been doing a lot of tests and the only possible way without an error is to use a cpdef enum inside a .pyx file. As soon as your are declaring a cpdef enum in a .pxd file, you get the mentioned error.
A possible workaround might be to put a plain cdef enum test: pass inside a .pxd file and use this for reference in e.g. C-Function declarations. For the Python part, you use the cpdef enum. I think this might work.
Another error in connection with cpdef enum occurs when using a C enum like the following:
typedef enum { A, B, C, D } test;
This should result in a few compiler errors. Maybe you can check that too so that I can make sure I am not the only one with these compile errors.
When using a normal cdef enum these compile errors do not occur.
#lib.h
typedef enum { A, B, C, D } test;
#test.pyx
cdef extern from "lib.h":
cpdef enum test:
A, B, C, D
It is working when the C enum is declared like this: typedef enum test { A, B, C, D} test; or typedef enum test { A, B, C, D};
I think that cpdef enum is not working quite correctly ...
Alex