I'm trying to bind a C++ library that comes with a SWIG interface file. However, when I try to compile the wrapper code that is generated by
swig -c++ -perl5 pwiz_swigbindings.iI get ~ 3k lines of warnings and errors. The first 50 lines are included here:
In file included from pwiz_swigbindings_wrap.cxx:745:0: /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/XSUB.h:126:39: error: referen +ce to ‘CV’ is ambiguous #define XSPROTO(name) void name(pTHX_ CV* cv) ^ /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/XSUB.h:145:44: note: in expan +sion of macro ‘XSPROTO’ # define XS_EXTERNAL(name) extern "C" XSPROTO(name) ^ /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/XSUB.h:156:18: note: in expan +sion of macro ‘XS_EXTERNAL’ #define XS(name) XS_EXTERNAL(name) ^ pwiz_swigbindings_wrap.cxx:2149:1: note: in expansion of macro ‘XS’ XS(_wrap_new_vectord__SWIG_0) { ^ In file included from pwiz_swigbindings_wrap.cxx:744:0: /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/perl.h:2317:19: note: candida +tes are: typedef struct cv CV typedef struct cv CV; ^ In file included from pwiz_swigbindings_wrap.cxx:1862:0: ../../../data/common/cv.hpp:12996:22: note: struct pwi +z::cv::CV struct PWIZ_API_DECL CV ^ In file included from pwiz_swigbindings_wrap.cxx:745:0: /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/XSUB.h:126:39: error: ‘CV’ ha +s not been declared #define XSPROTO(name) void name(pTHX_ CV* cv) ^ /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/XSUB.h:145:44: note: in expan +sion of macro ‘XSPROTO’ # define XS_EXTERNAL(name) extern "C" XSPROTO(name) ^ /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/XSUB.h:156:18: note: in expan +sion of macro ‘XS_EXTERNAL’ #define XS(name) XS_EXTERNAL(name) ^ pwiz_swigbindings_wrap.cxx:2149:1: note: in expansion of macro ‘XS’ XS(_wrap_new_vectord__SWIG_0) { ^ /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/XSUB.h:126:39: error: referen +ce to ‘CV’ is ambiguous #define XSPROTO(name) void name(pTHX_ CV* cv) ^ /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/XSUB.h:145:44: note: in expan +sion of macro ‘XSPROTO’ # define XS_EXTERNAL(name) extern "C" XSPROTO(name) ^ /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/XSUB.h:156:18: note: in expan +sion of macro ‘XS_EXTERNAL’ #define XS(name) XS_EXTERNAL(name) ^ pwiz_swigbindings_wrap.cxx:2177:1: note: in expansion of macro ‘XS’ XS(_wrap_new_vectord__SWIG_1) { ^ In file included from pwiz_swigbindings_wrap.cxx:744:0: /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/perl.h:2317:19: note: candida +tes are: typedef struct cv CV typedef struct cv CV;
Please bear with me - I'm not much into C/C++ or the Perl internals - but it seems like CV is a core Perl symbol as well as being defined as a class by the library I'm binding, which is causing problems. The rest of the errors/warnings seems to relate to 'CV' as well. In the external library, 'CV' is defined within the "pwiz::cv::" namespace, but it still seems to be conflicting.
Has anyone dealt with a similar issue or have any guidance on how to get around this?
In reply to SWIG and conflicting definitions by jdv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |