URGENT: IDL_STRING variable in calling C from IDL when update from IDL5.4 to 5.6 [message #37019] |
Thu, 20 November 2003 23:07  |
xje4e
Messages: 18 Registered: February 2002
|
Junior Member |
|
|
Hi, there,
I am building program that calls C from IDL by DLM. In IDL, the
function passed only one parameter that is a string, such as
'test.txt'. In C, use argv[0]->value.str.s to read the string out.
In IDL 5.4, the program works well.
I updated IDL from 5.4 to 5.6, the program is dead. I debug the
program and found that when I use IDL5.4 to debug, the
argv[0]->value.str.s has the right input: 'test.txt'. However, when I
use IDL5.6 to debug, the argv[0]->value.str.s is NULL.
How can this happen? Is this a bug in IDL5.6 or RSI changed something
about the IDL_string strucure? I test the program in IDL6.0, the same
error happened.
Any help will be appreciated,
Jin
|
|
|
|
Re: URGENT: IDL_STRING variable in calling C from IDL when update from IDL5.4 to 5.6 [message #37085 is a reply to message #37019] |
Mon, 24 November 2003 12:36  |
xje4e
Messages: 18 Registered: February 2002
|
Junior Member |
|
|
> Yes, they changed the length field slen from short to IDL_STRING_SLEN_T
> (which is currently int) so the structure changed. I think it's documented
> in the release notes.
>
> You need to recompile your C code using the header files from IDL 5.6.
Thank you very much! It works.
However, I do not think they need to change it and let the customer to
recompile it after upgrading. It's better to keep the new version
compatible to the previous versions.
Jin
|
|
|
Re: URGENT: IDL_STRING variable in calling C from IDL when update from IDL5.4 to 5.6 [message #37116 is a reply to message #37019] |
Fri, 21 November 2003 02:13  |
Nigel Wade
Messages: 286 Registered: March 1998
|
Senior Member |
|
|
Xiaoying Jin wrote:
> Hi, there,
>
> I am building program that calls C from IDL by DLM. In IDL, the
> function passed only one parameter that is a string, such as
> 'test.txt'. In C, use argv[0]->value.str.s to read the string out.
> In IDL 5.4, the program works well.
>
> I updated IDL from 5.4 to 5.6, the program is dead. I debug the
> program and found that when I use IDL5.4 to debug, the
> argv[0]->value.str.s has the right input: 'test.txt'. However, when I
> use IDL5.6 to debug, the argv[0]->value.str.s is NULL.
>
> How can this happen? Is this a bug in IDL5.6 or RSI changed something
> about the IDL_string strucure? I test the program in IDL6.0, the same
> error happened.
>
> Any help will be appreciated,
>
> Jin
Yes, they changed the length field slen from short to IDL_STRING_SLEN_T
(which is currently int) so the structure changed. I think it's documented
in the release notes.
You need to recompile your C code using the header files from IDL 5.6.
--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
|
|
|