Dereferencing pointer to incomplete type error for struct member access in Python swig C wrapper

What is the error while compiling swig Python wrapper under GCC 4.8.2?

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);

source code from 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);
...

header file /usr/local/include/wfdb/wfdb.h:

...
struct WFDB_siginfo {   /* signal information structure */
    char *fname;    /* filename of signal file */
    ...
};
...


Source: gcc

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.