[scilab-Users] Link with Scilab

Sylvestre Ledru sylvestre.ledru at scilab.org
Wed Sep 9 00:37:01 CEST 2009


Le mardi 08 septembre 2009 à 18:21 -0400, Romain Cotte a écrit :
> 
> 
> 
> 
> Hello,
> 
> I would like to make a link with fortran code but which needs a C
> library. I can obtain an executable a.out by this way :
> 
> gcc -c lib1.c lib2.f subroutine.f
> 
> I tried : l=ilib_for_link('rosen',['lib1.o','lib2.o','subroutine.o'],
> [],'f',PWD+'/Makefile');
> (gcc -c lib1.c -o lib1.o)
If you are using scilab >= 5.0, please use actual file name (.c instead
of .o).
Makefile are no longer necessary (they are generated on the fly).

> but i get errors which are only warnings with gcc :
> 
> !adStack.c:351: warning: format '%li' expects type 'long int', but
> argument 4 has type 'int'  !
> !adBuffer.c:41: error: expected specifier-qualifier-list before
> 'longint'                     !
Looks like a missing include.
By the way, I cannot see any references to adBuffer.c or adStack.c in
your command upper (ilib_for_link). 

> I wonder if it's possible to modify options for compilation or if
> there is an another way.
> Makefile :
> 
> OBJS =  rosenf.o
> OTHERLIBS =
> LIBRARY = librosenf
> include $(SCIDIR)/Makefile.incl
> CFLAGS = $(CC_OPTIONS)
> FFLAGS = $(FC_OPTIONS)
> EXTRA_LDFLAGS =
> include $(SCIDIR)/config/Makeso.incl
Where did you find this makefile ?
This way of using dynamic link has been deprecated a while ago.

Sylvestre

-- 
-------------------------
Sylvestre Ledru
-------------------------
The Scilab Consortium
Digiteo
Domaine de Voluceau
Rocquencourt - B.P. 105
78153 Le Chesnay Cedex
France




More information about the users mailing list