help-octave
[Top][All Lists]
Advanced

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

using user defined function in a stand alone c++ application


From: Michael Bernward Schmidt
Subject: using user defined function in a stand alone c++ application
Date: Wed, 24 Jan 2007 16:17:06 +0100

Hello

I would like to use a user defined function in an stand alone c++ application. 
I defined the following user function octavetest.m.
function [a]=octavetest(x);
a=x;

Now I wrote the following c++ application to call that function. (hello.cc)

#include <iostream>
#include <octave/oct.h>
#include <octave/parse.h>
#include <octave/variables.h>

using namespace std;
 int main(void)
 {
        std::cout << "Hello octave world!\n" << endl;
        initialize_symbol_tables();
        octave_value retval;  
        octave_value_list args;
        args(0) = "octavetest";
        args(1) = 2;    
        retval=feval("feval",args);    
   
 
     return 0;
 }

I compiled the the app with the following command without any error.
 
mkoctfile --link-stand-alone hello.cc -o hello

but when I execute the programm the following error occurs.
$ ./hello 
Hello octave world!

error: feval: the symbol `feval' is not valid as a function

Can somebody help me?

Greetings 

Michael

PS. Sorry for my bad english


 
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066



reply via email to

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