[scilab-Users] gateway fortran cpp

Benoit Goepfert goepfert.benoit at gmail.com
Thu Jul 21 10:36:12 CEST 2011


I figured out where the problem came from. The fortran function just needs
to have the same name than the fortran file where it's implemented,
otherwise Scilab can't find it.

2011/7/20 Pedro Ledoux <p_ledoux at yahoo.com.br>

> about Fortran for which and why are you using it? I`ve wrked as Fortran
> progeamer to a geologist.
> I was able to make the main program in C which could call Fortran functions
> using the compilers gcc and
> Open64.
>
> *De:* Benoit Goepfert <goepfert.benoit at gmail.com>
> *Para:* users at lists.scilab.org
> *Enviadas:* Quarta-feira, 20 de Julho de 2011 3:06
> *Assunto:* [scilab-Users] gateway fortran cpp
>
> Hello,
>
> I'm currently creating a toolbox that contains c++ and fortran files. As I
> handle c++ objects, it's more convenient for me to use c++ files in my
> gateway. Thus, for the compilation in scilab, I just need a header where i
> summerize all my functions as follows :
>
> extern "C"{
> int func1(char *fname)
> int func2(char *fname)
> ...
> } "
>
> When those functions "func1", "func2" are linked to the c++ original code,
> the compilation in scilab works perfectly (builder and loader).
> However, when those functions are linked to the fortran original code
> (which means that in my gateway file, I call a fortran function with "F2C"),
> the compilation in scilab doesn't work and i get the following error while
> I'm trying to execute the loader (the builder passes) :
>
> addinter(libsplspcgateway_path + filesep() + 'libsplspcgateway' +
> getdynlibext(), 'libsplspcgateway', list_functions);
>
> !--error 236
> addinter: The shared archive was not loaded:
> /home/.../sci_gateway/cpp//libsplspcgateway.so: undefined symbol: BAGMRES_
>
> (where BAGMRES is the fortran function that I call with F2C in my gateway
> file in c++).
>
> As I already succeeded to use fortran functions in gateway files in c, my
> question is the following :
> Is it forbidden to call a fortran file in a gateway file in c++ and must I
> use inevitably a gateway file in c?
> If on contrary it's possible, where could the problem come from?
>
> I hope to be clear and I thank you for your help.
> Best regards,
>
> --
> Benoit Goepfert
>
>
>
>


-- 
Benoit Goepfert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20110721/106b9621/attachment.htm>


More information about the users mailing list