From help-request at octave dot org Fri Feb 3 04:20:41 2006 Subject: Re: How to write a c++ application using cygwin? From: Stefan van der Walt To: help at octave dot org Date: Fri, 3 Feb 2006 12:16:34 +0200 --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Fri, Feb 03, 2006 at 09:13:29AM +0100, Hermann Schloss wrote: > The question now is, how can I create an application (for example see below) > using octave under cygwin? > > #include > #inlcude > #include > > using namespace std; > > int main() > { > Matrix m = (3,2); > // filling the matrix > Matrix n = m.inverse(); > cout << n; > return 0; > } You should modify your program to include Matrix.h instead. Also, you cannot invert a 3x2 matrix. A matrix is initialised by doing Matrix m = Matrix(3,2,0); or Matrix m(3,2,0); (You can also do Matrix m(3,2); but then you need to make sure that you manually initialise *all* the values). Your code can be compiled using something similar to $ mkoctfile --link-stand-alone -v testoctave.cc -o testoctave Regards Stéfan --ew6BAiZeqk4r7MaW Content-Type: text/x-c++src; charset=us-ascii Content-Disposition: attachment; filename="testoctave.cc" #include #include #include using namespace std; int main() { Matrix m(3,3,0); // filling the matrix Matrix n = m.inverse(); cout << n; return 0; } --ew6BAiZeqk4r7MaW-- ------------------------------------------------------------- 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 -------------------------------------------------------------