[Top][All Lists]

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

Re: oct-file compiling problem

From: A. Scottedward Hodel
Subject: Re: oct-file compiling problem
Date: Wed, 7 Jun 2006 17:36:16 -0500

In a Unix/Linux/MacOS system, you would write
mkoctfile square_function.o 
(assuming that you compiled square_function separately), or you could write

On Jun 7, 2006, at 8:03 AM, address@hidden wrote:


I use octave 2.1.73 under cygwin and I am currently developing my first first C++ oct-file. Now, I have a problem using mkoctfile.  I included an example below to illustrate my problem. When calling the function "square_double" contained in square_function, I do not no how to tell mkoctfile to compile square_function and link it to my main program. All three files reside in the same directory, which is c:\octave-files. When I call "mkoctfile" I get an error saying "undefined reference to 'square_double(double)' ". How do I use mkoctfile correctly?

Thanks in advance for your help
#include <octave/oct.h>
#include "square_function.h"

DEFUN_DLD (mainprogram, args, ,  "returns the squared input value")
 octave_value retval;
 double a = args(0).scalar_value();
 a = square_double(a);
 retval = octave_value(a);
 return retval;  


double square_double (double val);

#include "square_function.h"

double square_double (double val){
  val = val * val;
  return val;
Help-octave mailing list

reply via email to

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