我正在尝试让Scilab的api运行scilab操作(我想通过qt使用scicv Scilab模块),但是call_scilab遇到了一些问题:
我目前正在使用Scilab 6.0.1和Qt 5.5。
在我的项目的.pro中,我添加了:
INCLUDEPATH += sclilabpath/modules/api_scilab/includes
INCLUDEPATH += scilabpath/modules/call_scilab/includes
我还添加了库
LIBS+= -Lscilabpath/bin \
-lcall_scilab\
-lapi_scilab \
-lcore
我已经成功导入了scilab api,但是在scilab tuto中使用call_scilab时遇到了问题:
// A simple call_scilab example
#define _MSC_VER
#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;
}
此代码返回
undefined reference to 'StartScilab'
undefined reference to 'SendScilabJob'
undefined reference to 'TerminateScilab'
一些较早的帖子建议将所有scilab库添加到.pro文件中,但我不确定这是最好的解决方案。
有人对我有提示吗?