N
None
Hi,
I was trying to use SWIG to expose some C++ functions to perl. But, I
ran into some issues here. I don't know why, but I see that a macro in
SWIG replaces "NORMAL" with "PL_op->op_next"...
I ran the following test:
Files:
test.cxx:
#include "test.h"
test.h:
enum User
{
NORMAL = 1,
FOREIGN = 2
};
test.i:
/* File : test.i */
%module test
%{
#include "test.h"
%}
/* Let's just grab the original header file here */
%include "test.h"
If I run the Makefile (similar to the one in Examples/Perl5 directory
in SWIG), it gives the following error :
In file included from test_wrap.cxx:1464:
test.h:5: error: `PL_op' redeclared as different kind of symbol
/prj/qisdcrm/QChat/perl-5.6.1-Linux/lib/5.6.1/i686-linux/CORE/thrdvar.h:25:
error: previous declaration of `OP*PL_op'
test.h:5: error: declaration of `PL_op'
/prj/qisdcrm/QChat/perl-5.6.1-Linux/lib/5.6.1/i686-linux/CORE/thrdvar.h:25:
error: conflicts with previous declaration `OP*PL_op'
test.h:5: error: expected `}' before '->' token
test.h:5: error: expected unqualified-id before '->' token
test.h:8: error: expected declaration before '}' token
make[1]: *** [perl5_cpp] Error 1
It seems that some macro replaces "NORMAL" with "PL_op->op_next". I ran
a "grep" for "NORMAL" in the SWIG directory, but could not find
anything that replaces it. Can anyone help me with this?
Thanks,
Avinash.
I was trying to use SWIG to expose some C++ functions to perl. But, I
ran into some issues here. I don't know why, but I see that a macro in
SWIG replaces "NORMAL" with "PL_op->op_next"...
I ran the following test:
Files:
test.cxx:
#include "test.h"
test.h:
enum User
{
NORMAL = 1,
FOREIGN = 2
};
test.i:
/* File : test.i */
%module test
%{
#include "test.h"
%}
/* Let's just grab the original header file here */
%include "test.h"
If I run the Makefile (similar to the one in Examples/Perl5 directory
in SWIG), it gives the following error :
In file included from test_wrap.cxx:1464:
test.h:5: error: `PL_op' redeclared as different kind of symbol
/prj/qisdcrm/QChat/perl-5.6.1-Linux/lib/5.6.1/i686-linux/CORE/thrdvar.h:25:
error: previous declaration of `OP*PL_op'
test.h:5: error: declaration of `PL_op'
/prj/qisdcrm/QChat/perl-5.6.1-Linux/lib/5.6.1/i686-linux/CORE/thrdvar.h:25:
error: conflicts with previous declaration `OP*PL_op'
test.h:5: error: expected `}' before '->' token
test.h:5: error: expected unqualified-id before '->' token
test.h:8: error: expected declaration before '}' token
make[1]: *** [perl5_cpp] Error 1
It seems that some macro replaces "NORMAL" with "PL_op->op_next". I ran
a "grep" for "NORMAL" in the SWIG directory, but could not find
anything that replaces it. Can anyone help me with this?
Thanks,
Avinash.