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 */
...
};
...
You declare this type:
and use this one:
which is different (note the uppercase S), so gcc truly believes struct WFDB_Siginfo is another type which has not been declared yet.