[scilab-Users] new api_scilab and stack-c.h
Mike Page
Mike at Page-One.Waitrose.com
Tue Jan 10 23:12:25 CET 2012
Hi Till,
I have found exactly the same problem. I have built a library in C for use
with Scilab and I also have to include both api_scilab.h and stack-c.h in
order for the code to compile. Although the warning says it is deprecated,
it does appear to work correctly as of Scilab 5.3.3. But I agree, we will
have some extra work to do if stack-c.h is removed in Scilab 6.0.
I look forward to hearing the official answer to this problem.
Regards,
Mike.
-----Original Message-----
From: Till Straumann [mailto:Till.Straumann at alumni.TU-Berlin.de]
Sent: 10 January 2012 21:14
To: users at lists.scilab.org
Subject: [scilab-Users] new api_scilab and stack-c.h
Hello.
I'm looking into migrating a toolbox (written in C/C++)
to the new 'api_scilab'. I had used 'stack-c.h' in the past
which now warns that this is deprecated and that it will
be removed.
However, I'm unable to build any of the api_scilab examples
without also including 'stack-c.h' (or I get a lot of errors)
plus, at the top of stack-c.h we find
#ifndef API_SCILAB_VERSION
#pragma message("Using stack-c.h is deprecated. Please use api_scilab
instead (try 'help api_scilab'). Note the stack-c.h API will be removed
after Scilab 6.0.")
#endif
so it seems we must
#include <api_scilab.h>
#include <stack-c.h>
for now. Is that not somewhat broken by design? Assuming I
upgrade everything to api_scilab then I'll have to work on
it again after scilab-6.0 (since stack-c.h is gone by then) ?
Can someone shed some light, please?
Please CC me - I'm not subscribed to the mailing list.
Thanks
-- Till
PS: I tried to compile the example given on the scilab-5.3.3
help page for getVarType() (API Scilab>Low level functions>Variable Type
(Scilab gateway))
Unfortunately, the example doesn't contain any #include directives.
If I #include <api_scilab.h> at the top then the compiler says:
gcc -I /usr/include/scilab/ tst.c -c -O2
tst.c: In function ‘common_function’:
tst.c:13:21: error: ‘Rhs’ undeclared (first use in this function)
tst.c:13:21: note: each undeclared identifier is reported only once for
each function it appears in
tst.c:33:15: error: lvalue required as left operand of assignment
tst.c: In function ‘printf_info’:
tst.c:65:14: error: ‘sci_matrix’ undeclared (first use in this function)
tst.c:68:14: error: ‘sci_poly’ undeclared (first use in this function)
tst.c:71:14: error: ‘sci_boolean’ undeclared (first use in this function)
tst.c:74:14: error: ‘sci_sparse’ undeclared (first use in this function)
tst.c:77:14: error: ‘sci_boolean_sparse’ undeclared (first use in this
function)
tst.c:80:14: error: ‘sci_ints’ undeclared (first use in this function)
tst.c:101:14: error: ‘sci_strings’ undeclared (first use in this function)
tst.c:104:14: error: ‘sci_list’ undeclared (first use in this function)
tst.c:107:14: error: ‘sci_tlist’ undeclared (first use in this function)
tst.c:110:14: error: ‘sci_mlist’ undeclared (first use in this function)
but if I
#include <api_scilab.h>
#include <stack-c.h>
then the compilation goes through without errors.
--
To unsubscribe from this mailing-list, please send an empty mail to
users-unsubscribe at lists.scilab.org
To check the archives of this mailing list, see
http://mailinglists.scilab.org/
More information about the users
mailing list