在GCC 4.8.2下编译swig Python包装器时出错是什么意思?
wfdb_python_wrap.c:3967:11: error: dereferencing pointer to incomplete type
if (arg1->fname) free((char*)arg1->fname);
^
wfdb_python_wrap.c:3967:36: error: dereferencing pointer to incomplete type
if (arg1->fname) free((char*)arg1->fname);
来自wfdb_python_wrap.c
的源代码:
...
#include <wfdb/wfdb.h>
...
#ifdef __cplusplus
extern "C" {
#endif
SWIGINTERN PyObject *_wrap_WFDB_Siginfo_fname_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
...
struct WFDB_Siginfo *arg1 = (struct WFDB_Siginfo *) 0 ;
...
if (arg1->fname) free((char*)arg1->fname);
...
标题文件/usr/local/include/wfdb/wfdb.h
:
...
struct WFDB_siginfo { /* signal information structure */
char *fname; /* filename of signal file */
...
};
...
答案 0 :(得分:2)
您声明此类型:
struct WFDB_siginfo
并使用这个:
struct WFDB_Siginfo
是不同的(注意大写的S),所以gcc真的认为struct WFDB_Siginfo是另一种尚未声明的类型。