Help required in running a C program in scilab

Hi all,
I am new to Scilab and I need to know, " How to run a C program in Scilab". I have a C program statement and I need to run the same in Scilab, so that I can access the C code using Scilab. Help is appreciated. Thanks in advance.

Scilab 16-11-16, 3:26 p.m. Vijay_Karthik



Please look at the following links- https://help.scilab.org/docs/6.0.0/en_US/ilib_build.html https://help.scilab.org/docs/5.4.0/en_US/call.html Do look at the suggested functions at the bottom of the page.

16-11-16, 3:52 p.m. shamika


Hi Vijay_Karthik

Assuming you're running under a Linux-Like system (including MacOS), the way I'm doing that is simply by using the "host" function.
if your C program is called "myProgram" expecting two inputs let's say "a" & "b"
then something like
host('./myProgram a b')
should work.
Let us know

16-11-16, 6:06 p.m. moon61

What if I need to implement only a single statement of C code in scilab

16-11-16, 7:46 p.m. Vijay_Karthik

Login to add comment


do you mean that the need is about adding somewhere in a C-code (not compiled) a statement ?

Please be more explicit.

16-11-16, 7:48 p.m. moon61

What I mean is if I have only a single statement, say "int a" (in terms of C code), how do I implement this statement in Scilab

16-11-16, 7:52 p.m. Vijay_Karthik

Is there any function to implement such a statement

16-11-16, 7:52 p.m. Vijay_Karthik

Login to add comment


look for me it depends if this statement has to be included in your code at the first line, after the last one. in which case I think it's easy.

however if it's about adding a statement inside (somewhere between line 2 & x) then it'll require some work (at least for me

16-11-16, 7:55 p.m. moon61

please tell me that you're not running under windows things in which case I'm useless :-(

16-11-16, 7:55 p.m. moon61

I am sorry, I am running in Windows

16-11-16, 7:56 p.m. Vijay_Karthik

oops I'm sorry. then I just can't be of any help.

The reason is that Linux-like systems are much more appropriate for this kind of issues. Not saying that windows can't do, just that I don't know anything about MS Windows. Sorry

16-11-16, 7:58 p.m. moon61

OK, anyways thanks for your help

16-11-16, 7:58 p.m. Vijay_Karthik

Login to add comment


Hi all,
I somehow managed to link C files to Scilab. But right now the problem is when I try to use the c_link function for a particular routine name, its always showing False for any routine, even if the C file is linked to Scilab. Help is appreciated. Thanks in advance.

17-11-16, 7:14 p.m. Vijay_Karthik

I mean I somehow managed to link C code to Scilab

17-11-16, 7:54 p.m. Vijay_Karthik

Login to add comment


Can anyone let me know how to link C routines in Scilab. Thanks in advance.

23-11-16, 2:42 p.m. Vijay_Karthik

Log-in to answer to this question.