[Top][All Lists]

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

Help linking a C program to .oct files

From: Jerry
Subject: Help linking a C program to .oct files
Date: Mon, 29 Dec 2014 20:41:20 -0700

I'm use OS X 10.9.4 and I'm trying to link a C program* to one of Octave's 
"loadable functions," specifically the modified Bessel function of the second 
kind which, using nm, appears to be on my machine at


I'm not having any luck even though the octave documentation at

says they are shared libraries.

I have successfully linked and bound to other Octave functions but of the 
"built-in" type (at /opt/local/lib/octave/3.6.4/liboctave.dylib) so I feel that 
linking to these loadable functions should be possible too.

At one point I got the complaint that 

ld: can't link with bundle (MH_BUNDLE) only dylibs (MH_DYLIB) file 
for architecture x86_64 

which somehow prompted me to try

$ otool -hv besselj.oct 
Mach header 
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags 
MH_MAGIC_64  X86_64        ALL  0x00      BUNDLE    21       2128   NOUNDEFS 

At this point I'm in way over my head.

Does anyone have any idea what is in these .oct files and if it is possible to 
link to them? I suppose I could try compiling from source into a more familiar 


*Not really C but Ada (gcc Ada aka GNAT) using C calling conventions.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]