The ">" indicates the cmd prompt working directory: ``` C:\cmn\Julia-0.3.0>bin\ConsoleApplication2.exe 1.4142135623730951 ``` Otherwise, try passing the bin path as a char* to jl_init as suggested.
On Tue, Sep 30, 2014 at 11:24 AM, Stefan Babinec <[email protected]> wrote: > I've copied exe file directly to julia's bin directory Isaiah. > > And I get the above mentioned error when I try to run it in the bin > directory. > > > On Tuesday, September 30, 2014 4:57:41 PM UTC+2, Isaiah wrote: >> >> Try running it from the Julia directory as `bin\CommandLine2.exe`. This >> is very much a minimal example; for general use, the bin directory should >> be passed as an argument to `jl_init`: >> >> https://github.com/JuliaLang/julia/blob/1ee440bee5035ccb33f82b8a45febd >> dd2f973baa/src/jlapi.c#L70-L73 >> >> To go much further than this will really require to dig in to both >> jlapi.c and the general Julia source code. Be aware that dealing with type >> translation and garbage collection are both non-trivial. See also >> `examples/embedding.c` in the julia tree, and several previous discussion >> on the mailing list. >> >> On Tue, Sep 30, 2014 at 9:08 AM, Stefan Babinec <[email protected]> >> wrote: >> >>> Hi Isaiah. >>> >>> I tried and got this error: >>> "System image file " ?l\../lib/julia/sys.ji" not found" >>> >>> System Image sys.ji looks to be on his place and I have no problem >>> running Julia. >>> >>> Thanks. >>> >>> >>> On Tuesday, September 30, 2014 2:03:42 PM UTC+2, Isaiah wrote: >>>> >>>> I should mention that it is necessary to change the project target CPU >>>> from the default Any to x64 or x86 to match the libjulia architecture. >>>> On Sep 29, 2014 11:58 PM, "Isaiah Norton" <[email protected]> wrote: >>>> >>>>> I tried this some time ago during 0.2, so to make sure it still works >>>>> I made a minimal translation of the embedding example to C#: >>>>> >>>>> ``` >>>>> using System; >>>>> using System.Runtime.InteropServices; >>>>> >>>>> namespace ConsoleApplication2 >>>>> { >>>>> class Program >>>>> { >>>>> [DllImport("libjulia.dll")] >>>>> static extern void jl_init(); >>>>> [DllImport("libjulia.dll")] >>>>> static extern void jl_eval_string(string message); >>>>> >>>>> static void Main(string[] args) >>>>> { >>>>> jl_init(); >>>>> jl_eval_string("print(sqrt(2.0))"); >>>>> } >>>>> } >>>>> } >>>>> ``` >>>>> >>>>> I compiled this, copied the binary into `Julia-0.3.0\bin`, and it >>>>> works: >>>>> >>>>> ``` >>>>> C:\cmn\Julia-0.3.0>bin\ConsoleApplication2.exe >>>>> 1.4142135623730951 >>>>> ``` >>>>> >>>>> >>>>> On Mon, Sep 29, 2014 at 4:11 PM, Tobias Knopp < >>>>> [email protected]> wrote: >>>>> >>>>>> yep, I have done this (mostly for fun) before and it works. One needs >>>>>> some experience with P/Invoke of course but this is no magic but similar >>>>>> to >>>>>> our ccall. >>>>>> >>>>>> Cheers, >>>>>> >>>>>> Tobi >>>>>> >>>>>> Am Montag, 29. September 2014 20:52:10 UTC+2 schrieb Stefan Karpinski: >>>>>>> >>>>>>> I assume that you can call C libraries from .NET, right? The C >>>>>>> library for Julia is libjulia – how to call it from C is explained in >>>>>>> the >>>>>>> embedding docs, calling it from .NET should be similar. >>>>>>> >>>>>>> >>>>>>> > On Sep 29, 2014, at 12:37 PM, Guido De Bouver < >>>>>>> [email protected]> wrote: >>>>>>> > >>>>>>> > I have not found the C# examples, but I have not looked for them. >>>>>>> Sorry for that. >>>>>>> > >>>>>>> > So, any help on this, how could we call Julia from .NET ???? >>>>>>> > >>>>>>> >>>>>> >>>>> >>
