Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Boost.Python.ArgumentError_Python_C++_Boost - Fatal编程技术网

Boost.Python.ArgumentError

Boost.Python.ArgumentError,python,c++,boost,Python,C++,Boost,我最近在学习python,调用函数时出现了这个错误,希望有人能帮我。 在C++中: 在python中: class keywords(Structure): _fields_ = [('words', c_char *10),] class outStruct(Structure): _fields_ = [('kws', POINTER(keywords)), ('len', c_int),] test(byref(o)) 错误: ArgumentError:

我最近在学习python,调用函数时出现了这个错误,希望有人能帮我。 在C++中:

在python中:

class keywords(Structure):  
    _fields_ = [('words', c_char *10),]  
class outStruct(Structure):
     _fields_ = [('kws', POINTER(keywords)), ('len', c_int),]  
test(byref(o)) 
错误: ArgumentError:中的Python参数类型 您好,test(您好,CargoObject) 类外部结构(结构):
字段=[('kws',指针(关键字)),('len',c_int),]

我在谷歌上搜索了几个小时,没有找到任何好的解决办法。 我想用python获取结构。
感谢您的帮助。

不要将boost.python和ctypes混用。用boost.python包装您的C结构。
class keywords(Structure):  
    _fields_ = [('words', c_char *10),]  
class outStruct(Structure):
     _fields_ = [('kws', POINTER(keywords)), ('len', c_int),]  
test(byref(o))