logo       

Core dump in SWIG 1.3.17 - (newbie): msg#00107

programming.swig

Subject: Core dump in SWIG 1.3.17 - (newbie)

I am a newbie to SWIG. Here is my problem:

What is the equivalent of -
1. extern const xint8_t *<parameter> = "<value>"
and
2. the corresponding "typemap" statement
in the following piece of code under SWIG1.3.17?

For your information, the following code used to work
properly under SWIG 1.1p5.
=============================
%typemap(python, out) xint8_t**
{
xint32_t len=0;

while($source[len]) len++;
$target = PyList_New(len);

for(xint32_t i=0;i<len;i++)
PyList_SetItem($target, i, PyString_FromString($source[i]));
}

extern const xint8_t *pyBlack = "K";
extern const xint8_t *pyBlackLow = "KL";
extern const xint8_t *pyGreyScale = "Grey";
=============================

With the above codes, under SWIG 1.3.17, I could get
*_wrap.cxx file with the required C++ methods. But,
it does NOT generate any statements in the corresponding
python file. I was expecting the following lines in
the generated python file:
---------------------
pyBlack = _module.pyBlack
pyBlackLow = _module.pyBlackLow
pyGreyScale = _module.pyGreyScale
---------------------

Whereas the above lines exist with SWIG 1.1p5 generated
python files.

If I use the following statements instead of the
above three "extern" statements (without typemap statement),
I am getting a "Segmentation fault(Core dumped)" though
I could get the above three lines in the python file
generated under SWIG 1.3.17.
=======================================
%constant xint8_t *pyBlack = "K";
%constant xint8_t *pyBlackLow = "KL";
%constant xint8_t *pyGreyScale = "Grey";
=======================================

Please reply me at the earliest.

- Sharma K M

Attachment: InterScan_Disclaimer.txt
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise