problem with loader.sce (interfacing)
Samy
masy07 at wanadoo.fr
Tue Jun 8 16:49:21 CEST 2010
Hello,
I'm trying to interface C programs with Scilab by using SWIG as it has been advised to me.
I have followed the process :
* wrote the file "myfile.i"
* in the shell --> swig -scilab myfile.i (in the right directory)
* exec builder.sce in scilab
All seem to be working until here. Then I have to "exec loader.sce" in scilab but it doesn't work.
I have an example for a very (very) simple function :
* "essai.i" :
[
%module essai
%{
int somme(int x, int y);
%}
extern int somme(int x, int y);
]
* "essai.c" :
[
#include
int somme(int x, int y)
{
int res=x+y;
return res;
};
]
* here is the error message after executing "loader.sce" :
"
-->exec loader.sce
-->// This file is released into the public domain
-->// Generated by builder.sce : Please, do not edit this file
-->//
-->libessailib_path = get_file_path('loader.sce');
-->list_functions = [ 'somme';
-->];
-->addinter(libessailib_path+'/libessailib.so','libessailib',list_functions);
Link failed for dynamic library '/home/samy/Desktop/fonction1//libessailib.so'.
An error occurred: /home/samy/Desktop/fonction1//libessailib.so: undefined symbol: somme
Link failed for dynamic library '/home/samy/Desktop/fonction1//libessailib.so'.
An error occurred: /home/samy/Desktop/fonction1//libessailib.so: undefined symbol: somme
addinter(libessailib_path+'/libessailib.so','libessailib',list_functions);
!--error 236
addinter: The shared archive was not loaded: (null)
at line 7 of exec file called by :
exec loader.sce
"
I have tried to link the "libessailib.so" created after having executed "builder.sce". I link it just after executing "builder.sce" but I have a new error message :
"
-->link('/home/samy/Desktop/fonction1/libessailib.so')
Link failed for dynamic library '/home/samy/Desktop/fonction1/libessailib.so'.
An error occurred: /home/samy/Desktop/fonction1/libessailib.so: undefined symbol: somme
!--error 236
link: The shared archive was not loaded: (null)
"
I don't know why it does not work, I don't know if my file "essai.i" is not correct or if it is something else.
Could you help me please !!!
Thanks.
Samy
More information about the users
mailing list