Call_External and Re-Compiling C programs [message #12546] |
Thu, 20 August 1998 00:00  |
rmlongfield
Messages: 68 Registered: August 1998
|
Member |
|
|
Hi Everyone,
I've had some suucess using CALL_EXTERNAL to input IDL data to
a C program and recieve a result.
My problem is, when I use SPAWN to compile a C program, the
executable is not redefined within IDL. When I edit the C program and wish to
recompile, it doesn't work. I have to exit IDL to get rid of it.
-----------------------------
The IDL program is as follows:
PRO test
sh_command = 'testfile.sh'
c_command = 'testp'
SPAWN,sh_command
x=23
y=33
result = CALL_EXTERNAL('testp.so','testp',x,y)
print,'Result passed to IDL: ',result
help,/routines
end
++++++The shell program testfile.sh is:
rm *.o
rm *.so
echo Object files removed
cc -c -KPIC testp.c
ld -shared -o testp.so testp.o -lm
echo Finished compiling
# produces testp.o and testp.so
+++++++The output for all of this is:
IDL> test
Object files removed
Finished compiling
*__________________________________________
*____Value of argc: 2
*____Value of argv: 23
*____Value of argv: 33
*___________________________________________
Result passed to IDL: 56
Compiled Procedures:
$MAIN$
TEST
Compiled Functions:
Question: Does anyone know how to un-define the compiled procedures?
Thanks
Rose Dlh... (dlhopols@DELETE_THISknmi.nl)
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
|
|
|