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

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



In article <arkos-1204001537010001@merlin.phys.ucalgary.ca>, 
arkos@NOSPAMphys.ucalgary.ca (Gregory G. Arkos) wrote:

>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
>
   OK, Greg, you have not exported your library's symbols (that is: 
function names). There are several ways to do this. 

The easiest is:
Go to the CW project's Settings Panel and look for the PPC PEF settings 
panel under "Linker". Change the "Export" option from 'None' to 'All 
Globals'. Re-link; things should be fine. 

The better way is:
Do most of the previous, but this time select the 'Use ".exp" file' 
option for "Export". Link once, find the .exp file that was created for 
your project and open it for editing. Take out all but the function 
names you wish IDL to call (there could be hundreds you don't care 
about). Save the much reduced file and re-link.

         - Rob Preece
           UAH Dept. of Physics

Many thanks to the rest of you for enduring this somewhat of-topic, 
Mac-centric ramble. I'll go and re-lurk now...