ex_dld.C:10: macro `DEFUN_DLD' used with only 6 args
This could be extremely simple - I don't know any c++
- so any suggestions appreciated. However it seems to me
that DEFUN_DLD defined in defun-dld.h needs 7 arguments
(SFname is missing). Could this be anything to do with
whether octave is configured with DLD support?
(included the source files since they're very short)
Unfortunatly, can't recompile octave to check above since
my executables refuse to run across solaris-NFS !?
Also, will be upgrading to ELF soon. Since dld doesn't work
with ELF, will dynamic loading still work with octave?
ps: I am very impressed by octave and am having much trouble
believing its free. Muchas Muchas Gracias to 'jwe' and contributors.
------- ex_dld.C source follows -------
DEFUN_DLD ("hello", Fhello, Shello, -1, -1,
Print greeting followed by the values of all the arguments passed.\n\
Returns all the arguments passed.")
cerr << "Hello, world!\n";
int nargin = args.length ();
for (int i = 1; i < nargin; i++)
retval (nargin-i-1) = args(i).eval (1);
-------------- defun-dld.h follows ------
// defun-dld.h -*- C++ -*-
[GPL and jwe copyright snipped]
// Define a function that may be loaded dynamically at run time.
// If Octave is not configured for dynamic linking of builtin
// functions, this won't do anything useful.
// The forward declaration is for the struct, the second is for the
// definition of the function.
: Am interested in using dynamic loading with Octave.
: Downloaded, compiled & installed dld-3.3 for Linux a.out.
: Tried to compile example program in section 5.8 of documentation:
: # g++ -I/mnt/jay/octave-1.1.1/src -I/mnt/jay/octave-1.1.1/liboctave ex_dld.C
: Which yields:
: ex_dld.C:10: macro `DEFUN_DLD' used with only 6 args
: This could be extremely simple - I don't know any c++
: - so any suggestions appreciated. However it seems to me
: that DEFUN_DLD defined in defun-dld.h needs 7 arguments
: (SFname is missing).
The documentation is wrong. The example should begin with
: Could this be anything to do with whether octave is configured with
: DLD support?
No, the use of the DEFUN_DLD macro is the same in either case.
: Also, will be upgrading to ELF soon. Since dld doesn't work
: with ELF, will dynamic loading still work with octave?
The next release of Octave will support dynamic linking on systems
that support either dlopen/dlclose (Solaris, Irix, Linux, Digital
Unix, AIX, etc.) or shl_load/shl_findsym (HP/UX only?). Support for
dld has been dropped.