help-octave
[Top][All Lists]
Advanced

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

Re: Calling Octave from C++


From: Mike Miller
Subject: Re: Calling Octave from C++
Date: Mon, 26 Mar 2018 17:57:45 -0700
User-agent: Mutt/1.9.4 (2018-02-28)

On Tue, Mar 27, 2018 at 09:16:41 +0900, Tatsuro MATSUOKA wrote:
> #include <iostream>
> #include <octave/oct.h>
> #include <octave/octave.h>
> #include <octave/parse.h>
> #include <octave/interpreter.h>
> 
> int
> main (void)
> {
>   octave_value_list in;
>   // THIS CODE IS WORKING
>   int qq =10;
>   int rr =15;
>   in(0) = octave_value(qq);
>   in(1) = octave_value(rr);
>   octave_value_list out = feval ("gcd", in, 1);
>   std::cout << out(0).int_value ();
>   clean_up_and_exit(0);
> }
> 
> Still hang for me on current stable source (HG-ID 231847364696 upcoming 4.4).

This is not surprising at all because you haven't initialized the Octave
interpreter. This is not a complete example.

Please compare this code with examples/code/embedded.cc

  
https://hg.savannah.gnu.org/hgweb/octave/file/baa7e37453b1/examples/code/embedded.cc

And compare the equivalent example for Octave 4.2

  
https://hg.savannah.gnu.org/hgweb/octave/file/ea09770fb556/examples/code/embedded.cc

-- 
mike

Attachment: signature.asc
Description: PGP signature


reply via email to

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