Gandalf:~ pteeson$ nano libapl_test.c #include "/usr/local/include/apl/libapl.h"
int main (int argc, char * argv[]) { init_libapl(argv[0],0); return apl_exec("⎕←2 3⍴⍳6"); }
Gandalf:~ pteeson$ gcc -o libapl_test libapl_test.c -L /usr/local/lib/apl/ -lapl Gandalf:~ pteeson$ ./libapl_test 1 2 3 4 5 6 Gandalf:~ pteeson$
Thanks to everyone…..
per ardua ad astra….
respect….
Peter
From Apple’s Dynamic Libraries Programming Topics documentation - it’s an essential guide IMHO " To load dynamic libraries at runtime, apps should use a set of efficient and portable functions,
called dynamic loader compatibility functions. Using these functions ensures that dynamic
libraries are loaded in the most efficient way and facilitates the porting of apps from one platform
to another.This document is intended for developers of dynamic libraries and developers who use dynamic
libraries in their apps. You should be familiar with the Mac OS, UNIX, Solaris, or Linux operating
systems. You should also be an experienced C, C++, or Objective-C programmer.
This document explains how dynamic libraries are loaded at app launch time and how to use the
DLC functions, dlopen, dlsym, dladdr, dlclose, and dlerror, to load dynamic libraries at
runtime. This document also provides guidelines for developing dynamic libraries to be used by
client apps. " respect….
Peter
On Jul 2, 2018, at 11:32 AM, Juergen Sauermann < address@hidden> wrote:
Hi Elias,
that is actually what thge native function interface is doing: it
tries file,
then file.so
and then file.dylib.
I suppose the line given by Xiao-Yong below was taken from the gnu.info
documentation and is only
misleading when taken out of its context, The example in gnu.info
was assuming the presence a file
lib_file_io.so and then
explains how to use ⎕FX given that file. I suppose OSX users are smart
enough to figure that the
file names on their platform end with .dylib
instead of .so.
/// Jürgen
On 07/02/2018 04:18 PM, Elias Mårtenson
wrote:
Since .dylib is the standard extension for
libraries on OSX, it's probably a better idea to have an #ifdef
that checks for the operating system and chooses the correct
extension based on it.
If you ever wish to support Windows in the future, they use
.DLL.
|