PDA

View Full Version : Calling Scilab from Qt under Linux



drmath
7th July 2011, 15:29
I'm trying to link (by CallScilab APIs) a C++ Qt project to scilab environment. I'd like to know how to set .pro file (INCLUDEPATH, LIBS ...) to perform this link. I'm using Linux Scilab 5.1.1 (following Ubuntu 9.10 default installation), but I'm interested to newest versions (5.2, 5.3) procedure too.

mcosta
7th July 2011, 16:08
I suggest to read the qmake manual.

In general in INCLUDEPATH you have to set the path (relative or absolute) where you can find header files, in LIBS you have to set both the path and the name of libraries to find.

If you read this example (http://help.scilab.org/docs/5.3.2/en_US/compile_and_run_call_scilab.html) you have to set



INCLUDEPATH += $${PATH_SCILAB}/include/scilab
LIBS += -L$${PATH_SCILAB}/lib/scilab/ -lscilab

drmath
8th July 2011, 10:51
So far I've tried the settings

INCLUDEPATH += /usr/include/scilab/call_scilab
INCLUDEPATH += /usr/include/scilab/core
INCLUDEPATH += /usr/include/scilab

LIBS += /usr/lib/scilab/libscilab.so
LIBS += /usr/lib/scilab/libscicall_scilab.so
LIBS += /usr/lib/scilab/libjavasci.so

without results (I get undefined reference to callscilab APIs errors). What is wrong?

stampede
8th July 2011, 11:16
You want to perform dynamic linking, so I think LIBS should be more like:


LIBS += /usr/lib/scilab/
LIBS += -lscilab
LIBS += -lscicall_scilab
LIBS += -ljavasci

drmath
8th July 2011, 16:29
Still no results. For the sake of simplicity, I took readwritewmatrix_vc project from call_scilab/basicExamples folder and I built it, with the same issue ("undefined reference to..."). Note building on WinXp works fine. It would be very useful if someone having developed such a Linux project would post all config details, I've found lots of abstract documentation but only Win OS concrete code examples.