1
我有一個C函數,看起來像這樣:我想用用Cython把它包起來包裹的C代碼用Cython,有問題
int parse_commandline_options1 (cl1_option_t co[], char ***res,
char ***last_vals, int argc, char *argv[]);
,但我有問題。這是我用Cython代碼:
cdef extern from "pclo1.h":
ctypedef struct cl1_option_t:
pass
int parse_commandline_options1(cl1_option_t, char***, char***, int, char[]*)
cdef class Options:
cdef readonly cl1_option_t clo
cdef cl1_option_t Get(self):
return self.clo
property short_name:
def __get__(self):
return self.clo.short_name
property long_name:
def __get__(self):
return self.clo.long_name
def ParseCommandLine(char ***a, char ***b, char *c[]):
o = Options()
parse_commandline_options1(o.Get(), a, b, 0, c)
return o #^error here
用Cython告訴我,Cannot assign type 'char **' to 'char(*)[]'
但我不知道這個錯誤表示。你能告訴我我做錯了什麼嗎?我對C沒有太多經驗,很不幸.. 謝謝!