simple CALL_EXTERNAL [message #53777] |
Mon, 30 April 2007 14:19 |
skymaxwell@gmail.com
Messages: 127 Registered: January 2007
|
Senior Member |
|
|
how call c - function from IDL for Windows
for example example.cpp
double bmean(float *array,int n)
{
double total=0.0;
int i;
for (i=0;i<n;i++) total+=(*array++);
return (total/(double)n);
}
now i build example.dll
now from idl
idl> arr=randomu(s,1000000)*10000.0
idl>mean=call_external("D:\WORK\idl\example\Debug
\example.dll","bmean",arr, n_elements(arr),/d_value)
i've got error - not found procedure
CALL_EXTERNAL: Error loading sharable executable.
Symbol: bmean, File = D:\WORK\idl\example\Debug
\example.dll
also i try with
idl>mean=call_external("D:\WORK\idl\example\Debug\example.dll ","?
bmean@@YANPAMH@Z",arr, n_elements(arr),/d_value)
the same error
i was try on both VC7.0 and VC6.0
thanks
|
|
|