Thanks, with '-Wl,--stack,16777216' the example C program compiles and
prints 0 as expected. In fact, a lower value of 7536640 is sufficient.
Googling reveals (https://stackoverflow.com/a/1826072) there's "magick"
stack size of 7.4 MB, which matches what JE wants. And it explains "no
issues on Linux", as said in OP, with its 8 MB default. Was this change in
J from 8 to 9 versions intentional, is very much above my level. At least
now I know what to hack for my real application, if need be.


On Sun, Mar 6, 2022 at 4:33 AM bill lam <bbill....@gmail.com> wrote:

> JE expected a minimum stack size of 16mb. Try Building your front end with
> that stack size.
>
> On Sun, Mar 6, 2022, 6:35 AM vadim <vadim3128m...@gmail.com> wrote:
>
> > I'm considering to move a working program (which loads j.dll) from J
> > version 8.07 to current 9.03, but JDo fails to execute any sentence.
> >
> > (1) No issues with the previous 8.07 version.
> > (2) No issues on Linux.
> > (3) No issues with JInit, JFree, JSetM, JGetM.
> > (4) To confuse things more, no issues with calling JDo from 9.03 JQt
> > window, e.g.:
> >
> >    libj =: 'jj.dll'
> >    p =: (libj, ' JInit x') cd ''
> >    (libj, ' JDo i x *c') cd p, <'A =: i. 2 3'
> > +-+-------------+-----------+
> > |0|2534909943808|A =: i. 2 3|
> > +-+-------------+-----------+
> >
> > (5) Return code 17 when called from, e.g., the following C program,
> > compiled with mingw gcc (real program uses FFI and is not C).
> >
> > #include <windows.h>
> > #include <stdio.h>
> >
> > typedef void* (_stdcall *JInitType)(void);
> > typedef int (_stdcall *JDoType)(void*, LPSTR);
> >
> > int main(void) {
> >
> >     HINSTANCE hinstLib;
> >     JInitType JInit;
> >     JDoType JDo;
> >     void *j;
> >     int result;
> >
> > //    hinstLib = LoadLibrary("C:\\Users\\vadim\\j64-807\\bin\\j.dll");
> >     hinstLib = LoadLibrary("C:\\Users\\vadim\\j903\\bin\\j.dll");
> >     JInit = (JInitType) GetProcAddress(hinstLib, "JInit");
> >     JDo = (JDoType) GetProcAddress(hinstLib, "JDo");
> >
> >     j = (JInit)();
> >     printf("%u\n", j);
> >
> >     result = (JDo)(j, "vec =: i. 10");
> >     printf("%u\n", result);
> >
> >     return 0;
> > }
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to