[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiling shared libraries for use with call_external on a Mac



An addition to what I asked below:

I can add a "dummy" main() to the C file, and produce something 
which appears to be a shared library.  However, when I try to 
use call_external from the IDL side, I get the error:

% CALL_EXTERNAL: Error loading sharable executable.
                 Symbol: testing_external, File =
                 Documents:Arkos:SMS:PLOT:test_external_libs
                 symbol was not found
% Execution halted at:  TEST_CALL_EXTERNAL   18
  Documents:Arkos:SMS:PLOT:test_call_external.pro
%                       $MAIN$                 

I don't know if I am doing something wrong on the C side in 
creating the shared library, or on the IDL side in the 
implementation, so any suggestions would be appreciated.

Thanks again,

-- Greg


For those interested, the code consists of:

** C**

#include <stdio.h>

int testing_external(int argc, char *argv[]);

int testing_external(int argc, char *argv[])
{
  printf("Test.\n");  
  return(1); 
}

void main(void) 
{
}

** IDL **

PRO test_call_external

  MESSAGE, ' begins!', /INFORMATIONAL
  
  a = call_external("test_external_libs","testing_external", /i_value)

  MESSAGE, ' complete!', /INFORMATIONAL

  RETURN
END

> A question for those out there who have used call_external in IDL with 
> (hopefully) C subroutines on the Macintosh.  
> 
> I have an older version of Metrowerks Codewarrior (IDE 1.6.3, CW 9), 
> and have set the Project type to shared library, in the preferences 
> for the project.  However, it doesn't seem to want to compile and 
> produce the shared library (it keeps looking for main(), while 
> the C file I'm compiling only contains a collection of subroutines).

-- 
 Gregory G. Arkos          Institute for Space Research
 arkos@NOSPAMphys.ucalgary.ca    Department of Physics and Astronomy
 Voice : +1 403 220 6958   The University of Calgary
 FAX   : +1 403 282 5016   Calgary, Alberta, CANADA  T2N 1N4