Scilab configuration on Eclipse IDE for c++, Version Helios Service Release 2 [message #1753380] |
Sun, 05 February 2017 06:44  |
Eclipse User |
|
|
|
Hi,
I am trying to compile a simple c++ code calling the Scilab commands, using Eclipse IDE for c++, Version Helios Service Release 2. The following errors show up:
**** Rebuild of configuration Debug for project scilab_sample ****
**** Internal Builder is used for build ****
g++ -IC:\Program Files (x86)\scilab-5.5.2\modules\api_scilab\includes -IC:\Program Files (x86)\scilab-5.5.2\modules\call_scilab\includes -IC:\Program Files (x86)\scilab-5.5.2\modules\core\includes -IC:\Program Files (x86)\scilab-5.5.2\libs -IC:\Program Files (x86)\scilab-5.5.2\bin -O0 -g3 -Wall -c -fmessage-length=0 -oscilab.o ..\scilab.cpp
..\scilab.cpp: In function 'int main()':
..\scilab.cpp:25:52: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
SendScilabJob("myMatrix=['sample','for the help']");
^
..\scilab.cpp:26:33: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
SendScilabJob("disp(myMatrix);"); // Will display !sample for the help !
^
..\scilab.cpp:27:39: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
SendScilabJob("disp([2,3]+[-44,39]);"); // Will display - 42. 42.
^
g++ -oscilab_sample.exe scilab.o
scilab.o: In function `main':
C:\Users\van\workspace\scilab_sample\Debug/../scilab.cpp:16: undefined reference to `StartScilab'
C:\Users\van\workspace\scilab_sample\Debug/../scilab.cpp:25: undefined reference to `SendScilabJob'
C:\Users\van\workspace\scilab_sample\Debug/../scilab.cpp:26: undefined reference to `SendScilabJob'
C:\Users\van\workspace\scilab_sample\Debug/../scilab.cpp:27: undefined reference to `SendScilabJob'
C:\Users\van\workspace\scilab_sample\Debug/../scilab.cpp:30: undefined reference to `TerminateScilab'
collect2.exe: error: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 4769 ms.
This is my code:
// 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 I haven't configure the link correctly. Can anyone please help?
Many thanks,
Van
|
|
|
|
Powered by
FUDForum. Page generated in 0.10633 seconds