

Compile call_scilab in c++ using Eclipse IDE Helios Service Release 2
Hi,
I am very new to c++ and I am trying to compile a simple c++ code example using call_scilab on Eclipse IDE Helios Service Release 2 platform. I get the following errors:
**** Internal Builder is used for build ****
g++ -IC:\Program Files (x86)\scilab-5.3.3\modules -IC:\Program Files (x86)\scilab-5.3.3\modules\output_stream\includes -O0 -g3 -Wall -c -fmessage-length=0 -oscilab.o ..\scilab.cpp
..\scilab.cpp: In function 'int main()':
..\scilab.cpp:15:31: error: 'getenv' was not declared in this scope
if ( StartScilab(getenv("SCI"),NULL,NULL) == FALSE )
^
..\scilab.cpp:24:52: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
SendScilabJob("myMatrix=['sample','for the help']");
^
..\scilab.cpp:25:33: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
SendScilabJob("disp(myMatrix);"); // Will display !sample for the help !
^
..\scilab.cpp:26:39: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
SendScilabJob("disp([2,3]+[-44,39]);"); // Will display - 42. 42.
^
Build error occurred, build is stopped
Time consumed: 328 ms.
My code is:
// A simple call_scilab example
#include <stdio.h> /* stderr */
#include "api_scilab.h" /* Provide functions to access to the memory of Scilab */
#include "call_scilab.h" /* Provide functions to call Scilab engine */
// Filename: simple_call_scilab.c
int main(void)
{
/****** INITIALIZATION **********/
#ifdef _MSC_VER
if ( StartScilab(NULL,NULL,NULL) == FALSE )
#else
if ( StartScilab(getenv("SCI"),NULL,NULL) == FALSE )
#endif
{
fprintf(stderr,"Error while calling StartScilab\n");
return -1;
}
/****** ACTUAL Scilab TASKS *******/
SendScilabJob("myMatrix=['sample','for the help']");
SendScilabJob("disp(myMatrix);"); // Will display !sample for the help !
SendScilabJob("disp([2,3]+[-44,39]);"); // Will display - 42. 42.
/****** TERMINATION **********/
if ( TerminateScilab(NULL) == FALSE ) {
fprintf(stderr,"Error while calling TerminateScilab\n");
return -2;
}
return 0;
}
I suspect my configuration is not correct. Can anyone please help ? Many thanks.
Cheers,
Van
Scilab


Which Scilab version are you using? I would recommend doing this on Scilab 5.5 or later versions.
Login to add comment