help-octave
[Top][All Lists]
Advanced

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

C++ functions


From: Robert Widura
Subject: C++ functions
Date: Mon, 2 Jun 2003 06:31:25 -0500

Hello, 
 
I have some problems with the implementation of multiple C++ functions, when I 
use the 
command "mkoctfile". To understand how it works, I have written the following 3 
simple 
programs: 
 
funkprojekt_oct.cc: 
^^^^^^^^^^^^ 
 
#include <oct.h> 
#include "funktion_oct.h" 
 
DEFUN_DLD(funkprojekt_oct, args, , "test") 
{ 
        octave_value_list retval; 
        for (int i=1; i<=9; i++) 
        { 
                retval(i) = f(i); 
        } 
        return retval; 
} 
 
 
funktion_oct.h 
^^^^^^^^^ 
 
#include<oct.h> 
extern octave_value f(int i); 
 
 
 
funktion_oct.cc 
^^^^^^^^^^ 
 
#include<oct.h> 
#include "funktion_oct.h" 
 
DEFUN_DLD(f,args, ,"function definition") 
{ 
        octave_value_list retval; 
        int i; 
        i = args(0).int_value(); 
        retval(0) = i*i; 
        return retval; 
 } 
 
Now, when I am typing "mkoctfile funkprojekt_oct.cc" it is compiled without any 
errors. But when 
I try to start the function funkprojekt_oct at the Octave-prompt, I get the 
error-message: 
 
octave: relocation error: /home/octave/funkprojekt_oct.oct: undefined symbol: 
_Z1fi 
 
I would be glad, if you could help me with this special case and if you could 
explain to me the 
more general context... 
Thanks a lot, 
Robert Widura 
 
______________________________________________________________________________
UNICEF bittet um Spenden für die Kinder im Irak! Hier online an
UNICEF spenden: https://spenden.web.de/unicef/special/?mc=021101



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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