comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Problems with CALL_EXTERNAL on AIX
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Problems with CALL_EXTERNAL on AIX [message #600] Fri, 11 September 1992 21:28
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
I am trying to use the call external routine on an IBM R/6000 machine runninng
AIX 3.2 and IDL 2.3.2. I have succeeded in linking the following file as a
shareable object library.

main()
{
}

test1(argc, argv)
int argc;
void *argv[];
{
return(101);
}

test2(argc, argv)
int argc;
void *argv[];
{
return(102);
}

I compile this with:
cc -c -bloadmap:test.map test.c -o test.o

and link it with
ld -o shrtest.o test.o -bE:shrtest.exp -bM:SRE -T512 -H512 -lc

where shrtest.exp contains:
#!
test1
test2

If I link this shareable object library to a main C program it works fine,
test1 returns 101 and test2 returns 102.

However, when I try to call this from IDL I get the following:
; IDL Version 2.3.2 (AIX ibmr2)
; Journal File for rivers@xray1
; Working directory: /user/rivers
; Date: Sat Sep 12 00:05:48 1992

a = call_external('shrtest.o', '_test1')
print, a
; 101
a = call_external('shrtest.o', '_test2')
print, a
; 101
a = call_external('shrtest.o', 'zzzjunk')
print, a
; 101

It thus seems that IDL always calls the first function in the shareable object
library no matter what the second argument to call_external is. The last call
above should have given an IDL error.

Any idea what the problem is?


Mark Rivers
--
Mark Rivers (516) 282-7708 or 5626
Building 815 rivers@bnlx26.nsls.bnl.gov (Internet)
Brookhaven National Laboratory rivers@bnl (Bitnet)
Upton, NY 11973 BNLX26::RIVERS (Physnet)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: EXPAND.PRO - needed by CONTTW.PRO
Next Topic: Sig Proc: Phase Delay

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:22:55 PDT 2025

Total time taken to generate the page: 0.00430 seconds