在以两点为理由获取一种功能时,不要忘记和去掉一种奇怪的类型。
我的档案如下:
例:hpp
#ifndef _EXAMPLE_HPP
#define _EXAMPLE_HPP
class Example {
public:
void test_cc(char * c0, char * c1);
void test_cd(char * c0, double d0);
void test_cdp(char * c0, double * d0);
};
#endif // _EXAMPLE_HPP
例.cpp
#include "例:hpp"
void Example::test_cc(char * c0, char * c1) {}
void Example::test_cd(char * c0, double d0) {}
void Example::test_cdp(char * c0, double * d0) {}
例
%module Example
%{
#include "例:hpp"
%}
#include "例:hpp"
and finally my testfile test_Example.py:
#!/usr/bin/env python
import Example
E = Example.Example()
E.test_cc("Hello","World");
E.test_cd("Hello",42);
E.test_cdp("Hello",42);
When i run ./test_Example.py, i get the Error Message
Traceback (most recent call last):
File "./test_Example.py", line 9, in <module>
E.test_cdp("Hello",42);
File "Example.py", line 77, in test_cdp
def test_cdp(self, *args): return _Example.Example_test_cdp(self, *args)
TypeError: in method Example_test_cdp , argument 3 of type double *
获取功能测试—— ccwork, 测试_cd ......为什么不测试_cdp?
我的错误在哪里?