help-octave
[Top][All Lists]
Advanced

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

Re: problem with octave_main


From: address@hidden
Subject: Re: problem with octave_main
Date: Mon, 9 May 2016 06:21:48 +0900 (JST)

--- tmacchant
> ----- Original Message -----
> 
> > From: Tatsuro MATSUOKA 
> > To: "help-octave
> > Cc: 
> > Date: 2016/5/9, Mon 05:03
> > Subject: Re: problem with octave_main
> > 
> > It is custom that bottom posting in this mailing list.
> > 
> > See
> > https://en.wikipedia.org/wiki/Posting_style
> > 
> > 
> > Please use bottom posting so far.
> > My reply is written at the bottom.
> > 
> >> From: Koby Zalmanson 
> >> To: Tatsuro MATSUOKA  
> >> Date: 2016/5/9, Mon 04:49
> >> Subject: Re: problem with octave_main
> > 
> > 
> > 
> > 
> >> On Sun, May 8, 2016 at 8:41 PM, Tatsuro MATSUOKA 
> > <address@hidden> wrote:
> >> 
> >> ----- Original Message -----
> >>>> From: Koby Zalmanson 
> >>>> To: help 
> >>>> Date: 2016/5/8, Sun 22:39
> >>>> Subject: problem with octave_main
> >>>> 
> >>>> 
> >>>> Hi,
> >>>> I try to run the following  sample problem that is in the internet:
> >>>> int main()
> >>>> {
> >>>> string_vector argv(2);
> >>>> argv(0) = "embedded";
> >>>> argv(1) = "-q";
> >>>> 
> >>>> 
> >>>> if (octave_main(2, argv.c_str_vec(), 1))
> >>>> {
> >>>> 
> >>>> 
> >>>> std::cout << "GCD of [12, 16] is ";
> >>>> 
> >>>> 
> >>>> // Use octave_value_list directly as input
> >>>> octave_value_list in(2);
> >>>> in(0) = 12;
> >>>> in(1) = 16;
> >>>> 
> >>>> 
> >>>> octave_value_list out = feval("gcd", in, 1);
> >>>> 
> >>>> 
> >>>> std::cout << out(0).int_value() << std::endl;
> >>>> return 0;
> >>>> }
> >>>> else
> >>>> {
> >>>> error("Octave interpreter initialization failed");
> >>>> return 1;
> >>>> }
> >>>> 
> >>>> 
> >>>> }
> >>>> 
> >>>> 
> >>>> 
> >>>> 
> >>>> I run it on visual studio.
> >>>> The problem is that it fails at the line of octave main,
> >>>> and at the failing makes it to exit the program.
> >>>> 
> >>>> 
> >>>> At the error list on visual studio appears:
> >>>> 'TestOctave3.exe' (Win32): Loaded 
> > 'C:\Windows\SysWOW64\winnsi.dll'. Cannot find or open the 
> > PDB file.
> >>>> 'TestOctave3.exe' (Win32): Loaded 
> > 'D:\Octave-3.6.4\lib\octave\3.6.4\oct\i686-pc-mingw32\find.oct'. 
> > Module was built without symbols.
> >>>> 'TestOctave3.exe' (Win32): Unloaded 
> > 'D:\Octave-3.6.4\lib\octave\3.6.4\oct\i686-pc-mingw32\find.oct'
> >>>> The thread 0x27ac has exited with code 1 (0x1).
> >>>> 
> >>>> 
> >>>> Can you tell me what is the problem and what should be done?
> >>>> I'll appreciate any help.
> >>> 
> >>> 
> >>> 
> >>> You might not use the MS Visual studio because octave for windows was 
> > built using
> >>> mingw w64 (32 bit or 64 bit) gcc compiler.
> >>> 
> >>> If you want to write program using libraries bundled with octave, see 
> > octave manual.
> >>> 
> >>> http://www.gnu.org/software/octave/doc/interpreter/External-Code-Interface.html#External-Code-Interface
> >>> 
> >>> Almost case, you have to use mkoctfile script.
> >>> 
> >>> 
> >>> Tatsuro
> >>> 
> >>> 
> >> 
> >> 
> >> I am working on a big project that is written already in Visual. It is not 
> > relevant to use other compilers than visual.
> > 
> > 
> > 
> > Octave developers are not working with the Visual Studio staff.
> > In mxe-octave that is used to build octave for windows, there are some 
> > descriptions
> > for build octave for Visual C++ compiler.  
> > However, a main contributor related to the MSVC has not come to octave 
> > community 
> > recently.
> > You want to use Visual studio on windows you have to do a lot of things
> > with your best efforts. Perhaps there are no easy ways.
> > 
> > Tatsuro  
> > 
> I have overlooked you are using octave-3.6.4 built with MSVC.
> 
> See:
> http://wiki.octave.org/Octave_for_Microsoft_Windows#Octave_with_Visual_Studio 
> 
> Perhaps the above does not give what you fully want, but can  be used as 
> beginning. 
> Anyway I cannot state further for MSVC and octave for windows.
> 
Getting back the Sample program that you have shown,  it is an example to use 
octave from external program.  If you want to communicate with octave, you can 
use pipe.  In this case, kinds of complires is not relevant.

Tatsuro



reply via email to

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