|
From: | bob |
Subject: | Re: liboctave crash |
Date: | Fri, 27 Jul 2012 19:49:17 +0530 |
On Jul 27, 2012 7:35 PM, "Andy Buckle" <address@hidden> wrote:
>
>
>
> On 27 July 2012 14:58, Juan Pablo Carbajal <address@hidden> wrote:
>>
>> On Fri, Jul 27, 2012 at 1:38 PM, bob <address@hidden> wrote:
>> > Hi,
>> >
>> > I am trying to run this small code:
>> >
>> > #include <iostream>
>> > #include <octave/oct.h>
>> >
>> > using namespace std;
>> >
>> > int main() {
>> > ComplexMatrix A = ComplexMatrix(2,2);
>> > return 0;
>> > }
>> >
>> > Using octave-3.6.2 (MinGW), I am able to build the file. But when I run it,
>> > I get a seg-fault:
>> >
>> > Program received signal SIGSEGV, Segmentation fault.
>> > In libstdc++-6!_ZNKSs7_M_dataEv () (C:\MinGW\bin\libstdc++-6.dll)
>> >
>> > Even using:
>> >
>> > mkoctfile --link-stand-alone <file>
>> >
>> > I get the same crash.
>> >
>> > System: WinXP SP2 (32bit), Core 2 Duo
>> >
>> > Any help ?
>> > --
>> > bob
>> >
>> > _______________________________________________
>> > Help-octave mailing list
>> > address@hidden
>> > https://mailman.cae.wisc.edu/listinfo/help-octave
>> >
>>
>> You have tu use the dynamically loaded function macro. This is an
>> example form the manual
>> http://www.gnu.org/software/octave/doc/interpreter/Getting-Started-with-Oct_002dFiles.html
>>
>> #include <octave/oct.h>
>>
>> DEFUN_DLD (helloworld, args, nargout,
>> "Hello World Help String")
>> {
>> int nargin = args.length ();
>> octave_stdout << "Hello World has " << nargin
>> << " input arguments and "
>> << nargout << " output arguments.\n";
>> return octave_value_list ();
>> }
>>
>>
>>
>> --
>> M. Sc. Juan Pablo Carbajal
>
>
> If an oct-file function is required, then you have to use the macro. It looks like bob is trying to create something to be called from outside Octave.
Exactly. I am trying to create:
1. A standalone executable using octave functions.
2. A DLL binary also using octave functions.
>
> --
> /* andy buckle */
[Prev in Thread] | Current Thread | [Next in Thread] |