[Scilab-users] Call_scilab Linux c - undefined reference to `StartScilab' -
Mark Lautermann
mark-lautermann at live.de
Tue Aug 19 19:06:32 CEST 2014
Hi,
i installed Linux(32Bit) in a virtual mashine. Then installed scilab
from command line. Following folder struckture comes out:
/usr/lib/scillab
/usr/include/scilab
/usr/share/scilab
then i created a short c file test.c :
#include "stack-c.h"
#include "call_scilab.h" /* Provide functions to call Scilab engine */
int main(void)
{
if ( StartScilab(getenv("SCI"),NULL,NULL) == FALSE ) {
fprintf(stderr,"Error while calling StartScilab\n"); return -1;
}
SendScilabJob("myMatrix=['sample','for the help']"); return 0;
}
Set up:
export LD_LIBRARY_PATH=/usr/lib/scilab:$LD_LIBRARY_PATH
export SCI=/usr/share/scilab
Start:
gcc -o myExample -lscilab -L/usr/lib/scilab -I/usr/include/scilab test.c
(alternative see makefile )
*Error:*
gcc -o myExample -lscilab -L/usr/lib/scilab -I/usr/include/scilab test.c
test.c: In function \u2018main\u2019:
test.c:38:2: warning: passing argument 3 of \u2018StartScilab\u2019
makes integer from pointer without a cast [enabled by default]
if ( StartScilab(getenv("SCI"),NULL,NULL) == FALSE )
^
In file included from test.c:33:0:
/usr/include/scilab/call_scilab.h:43:10: note: expected \u2018int\u2019
but argument is of type \u2018void *\u2019
BOOL StartScilab(char *SCIpath, char *ScilabStartup, int Stacksize);
^
/tmp/ccqXRomB.o: In function `main':
test.c:(.text+0x48): undefined reference to `StartScilab'
test.c:(.text+0x7a): undefined reference to `SendScilabJob'
collect2: error: ld returned 1 exit status
-- tested on different Linux systems and with the Download version
scilab-5.5.0
has anyone tested this?
Mark
---
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.
http://www.avast.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20140819/4958acab/attachment.htm>
-------------- next part --------------
SHELL = /bin/sh
# A sample Makefile building a C code using Call Scilab using Scilab binary
PATH_SCILAB = /usr
# Note that PATH_SCILAB can be /usr/ is using a packaged version of Scilab.
SCILAB_CFLAGS = -I$(PATH_SCILAB)/include/scilab/
SCILAB_LDFLAGS = -lscilab
PATH_TO_LIB_SCILAB = $(PATH_SCILAB)/lib/scilab/
PATH_TO_LIB_CALL_SCILAB = $(PATH_SCILAB)/lib/scilab/
all: test.c
export LD_LIBRARY_PATH=$(PATH_TO_LIB_SCILAB):$(PATH_TO_LIB_CALL_SCILAB)
gcc -o myExample $(SCILAB_LDFLAGS) -L$(PATH_TO_LIB_SCILAB) -L$(PATH_TO_LIB_CALL_SCILAB) $(SCILAB_CFLAGS) test.c
More information about the users
mailing list