help-octave
[Top][All Lists]
Advanced

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

Regarding Standalone Program


From: Raghavendra K
Subject: Regarding Standalone Program
Date: Wed, 30 Jul 2008 13:15:33 +0530

Hi,
  I am trying to call octave functions from C, but getting an error.
This is the code that I am using

     #include <iostream>
     #include <octave/oct.h>
     int
     main (void)
     {
       std::cout << "Hello Octave world!\n";
       int n = 2;
       Matrix a_matrix = Matrix (n, n);
       a_matrix = zeros(n, n);
       std::cout << a_matrix;
       return 0;
     }

and I am compiling it using
./mkoctfile --link-stand-alone test.cc -o test
The error I am getting is

test.cc: In function `int main()':
test.cc:9: error: `zeros' undeclared (first use this function)
test.cc:9: error: (Each undeclared identifier is reported only once for each
   function it appears in.)

How do I make my C++ program understand that there is a zeros function declared in Octave?
Please do help me. Thanks a lot in advance.


--
Regards,
Raghavendra K

reply via email to

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