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

Home » Public Forums » archive » Call_External and Re-Compiling C programs
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
Call_External and Re-Compiling C programs [message #12546] Thu, 20 August 1998 00:00 Go to next message
rmlongfield is currently offline  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
Re: Call_External and Re-Compiling C programs [message #12609 is a reply to message #12546] Mon, 24 August 1998 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
rmlongfield@my-dejanews.com wrote:
>
> 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.

As far as I know, there is no way to get around this. When you
recompile a shared-object module, you must exit IDL and start
over.

Dave
--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Colors Common Block?
Next Topic: Path info in *.sav file

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

Current Time: Wed Oct 08 17:17:21 PDT 2025

Total time taken to generate the page: 0.00663 seconds