[Top][All Lists]

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

oct-file compiling problem

From: matthias . bergmeister
Subject: oct-file compiling problem
Date: Tue, 06 Jun 2006 14:51:23 +0200


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;
reply via email to

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