API Scilab 6 bug, including "Real life example" on help page https://help.scilab.org/docs/6.0.0/en_US/api_scilab_getting_started.html
Reported by Erik Benkler
BUG DESCRIPTION:
----------------
I can successfully compile and link C-code using the API Scilab 6 as described at https://help.scilab.org/docs/6.0.0/en_US/api_scilab_getting_started.html
However, when I try to execute the library function in Scilab, it appears that the parameter "nin" of
int sci_foo6(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* opt, int nout, scilabVar* out)
is ridiculously large (e.g. nin= 1235912 or similar), although when executing the library function in Scilab,
I only pass 2 input parameters (2 vectors of size 4x1).
Furthermore, the documentation of the Scilab API is extremely confusing, so as a newbie to this (I am used to
Matlab mex files), I might have done something wrong. If so, I would be glad if somebody could help / explain
in the scilab forum.
Why I am confused:
There exist at least two contradicting, different online help versions / Wikis referring to Scilab API 6 (I understand
that there is a difference between the APIs for Scilab 6 and for Scilab 5.3 and earlier, but the contradictions
are only for what refers to version 6):
1) https://help.scilab.org/docs/6.0.0/en_US/api_scilab_getting_started.html
2) https://wiki.scilab.org/GatewaysFromScilab5ToScilab6
I did not manage to get it work as expected, neither following approach 1), nor 2)
ERROR LOG:
----------
HOW TO REPRODUCE THE BUG:
-------------------------
Follow the "Real life example" at https://help.scilab.org/docs/6.0.0/en_US/api_scilab_getting_started.html
OTHER INFORMATION:
------------------
Compiler: Visual Studio 11 on Win7 32bit or 64bit [tested on two systems]
Scilab nightly: scilab-master-1484755002