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.<br><br><div class="gmail_quote">2011/7/20 Pedro Ledoux <span dir="ltr"><<a href="mailto:p_ledoux@yahoo.com.br">p_ledoux@yahoo.com.br</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div><span>about Fortran for which and why are you using it? I`ve wrked as Fortran progeamer to a geologist.</span></div><div><span>I was able to make the main program in C which could call Fortran functions using the compilers gcc and</span></div>
<div><span>Open64.</span></div><div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Arial"><div style="margin: 5px 0px; padding: 0px; border: 1px solid rgb(204, 204, 204); min-height: 0px; line-height: 0pt; font-size: 0px;" readonly>
</div><b><span style="font-weight: bold;">De:</span></b> Benoit Goepfert <<a href="mailto:goepfert.benoit@gmail.com" target="_blank">goepfert.benoit@gmail.com</a>><br><b><span style="font-weight: bold;">Para:</span></b>
 <a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br><b><span style="font-weight: bold;">Enviadas:</span></b> Quarta-feira, 20 de Julho de 2011 3:06<br><b><span style="font-weight: bold;">Assunto:</span></b> [scilab-Users] gateway fortran cpp<br>
</font><div><div></div><div class="h5"><br><div>Hello,<br><br>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 :<br>

<br>extern "C"{<br>int func1(char *fname)<br>int func2(char *fname)<br>...<br>} "<br clear="all"><br>When those functions "func1", "func2" are linked to the c++ original code, the compilation in scilab works perfectly (builder and loader).<br>

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) :<br>

<br>addinter(libsplspcgateway_path + filesep() + 'libsplspcgateway' + getdynlibext(), 'libsplspcgateway', list_functions);<br>                                                                                                                      !--error 236 <br>

addinter: The shared archive was not loaded: /home/.../sci_gateway/cpp//libsplspcgateway.so: undefined symbol: BAGMRES_<br><br>(where BAGMRES is the fortran function that I call with F2C in my gateway file in c++).<br><br>

As I already succeeded to use fortran functions in gateway files in c, my question is the following :<br>Is it forbidden to call a fortran file in a gateway file in c++ and must I use inevitably a gateway file in c?<br>If on contrary it's possible, where could the problem come from?<br>

<br>I hope to be clear and I thank you for your help.<br>Best regards,<br> <br>-- <br>Benoit Goepfert<br><br>
</div><br><br></div></div></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br>Benoit Goepfert<br><br>