[scilab-Users] Run C code function in Scilab

KLUGESHERZ, CHRISTIAN (CHRISTIAN) christian.klugesherz at alcatel-lucent.com
Fri Jul 23 15:21:48 CEST 2010


Hello

Does-nobody has an idea relative to my quest. :-(
I'm sure that I should be very close to the goal.

Thanks in advance

Christian

________________________________
De : KLUGESHERZ, CHRISTIAN (CHRISTIAN) [mailto:christian.klugesherz at alcatel-lucent.com]
Envoyé : vendredi 23 juillet 2010 11:15
À : users at lists.scilab.org
Objet : RE: [scilab-Users] Run C code function in Scilab

Ok,

Finally I tried the example "addinter.c" in unit_tests directory (See code below)

With "addinter.c" in my working directory:

When I run in Scilab

// Chemin de MinGW-toolbox
root_path = getenv('TOOLBOX_MINGW_PATH', 'D:\Documents and Settings\KLUGES1\My Documents\Perso\Simul_scilab_c\Install_Simul_C_Scilab\MinGW-toolbox');
exec(root_path + '\loader.sce');

Mingw Compiler support for Scilab
            Load macros
            Load help

 --------> (As I said it's OK :-) )

 --------> (Now to the issue)

files=['addinter.c'];
ilib_build('libintertest',['scifun1','intfun1'],files,[]);

I got

-->ilib_build('libintertest',['scifun1','intfun1'],files,[]);
   Generate a gateway file
   Generate a loader file
   Generate a Makefile: Makelib
 !--error 144
Undefined operation for the given operands.

check or define function %b_a_c for overloading.

at line      54 of function dlwGenerateMakefile called by :
at line      68 of function ilib_gen_Make called by :
at line      96 of function ilib_build called by :
ilib_build('libintertest',['scifun1','intfun1'],files,[]);

Please could you help

Thanks

Christian


PS: File: "addinter.c"

#include <math.h>
#include "stack-c.h"

static double fun2(double x);

void fun1(double *x,double *y)
{
  *y=fun2(*x)/(*x);
}

static double fun2(double x)
{
  return( sin(x+1));
}

int intfun1(char *fname)
{
  int m1,n1,l1;
  CheckRhs(1,1);
  CheckLhs(1,1);
  GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &l1);
  fun1(stk(l1),stk(l1));
  LhsVar(1) = 1;
  return 0;
}


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20100723/00f519d1/attachment.htm>


More information about the users mailing list