[Scilab-users] call_scilab from another dll

CHEZE David 227480 david.cheze at cea.fr
Thu Sep 26 17:03:42 CEST 2013


Hi Pascal,

I’ve done nothing around java path lib to make it work on WIN7-32bit Scilab5.4.1release : from the c example MVSC++ project I changed nothing but the point below about manifest to be able to build. What you report is ok anyway. Why did you include core.lib ? it’s not required at first sight.

David

De : quantparis at numericable.fr [mailto:quantparis at numericable.fr]
Envoyé : jeudi 26 septembre 2013 16:45
À : CHEZE David 227480; users at lists.scilab.org
Objet : Re: RE: [Scilab-users] call_scilab from another dll

Hi David,

I have added in the environment variable
user variable
SCI c:\Program Files\scilab-5.4.1\bin
system variable
add to the path c:\Program Files\scilab-5.4.1\bin

linker input:
api_scilab.lib
call_scilan.lib
core.lib

linker general
additional library directory
c:\Program Files\scilab-5.4.1\bin

the compile and link are ok, but the execution gives
"The native library scicommons does not exist or cannot be found
no scicommons in java.library.path
current java.library.path is:


is there something to do in visual studio, concerning a java.library.path?

thanks in advance
pascal



---- Message d'origine ----
De : "CHEZE David 227480" <david.cheze at cea.fr>
À : "quantparis at numericable.fr" <quantparis at numericable.fr>;
   "users at lists.scilab.org" <users at lists.scilab.org>
Objet : RE: [Scilab-users] call_scilab from another dll
Date : 25/09/2013 14:19:39 CEST
Hi Pascal,

I’ve nearly the same configuration as you but my OS is WIN7 32bits, not 64bits which introduces sometimes extra pbs.
I’m using MVSC++ 2010 express.
I  needed to run MVSC++ with a local admin account in order to open and convert automatically the example project provided in  C:\Program Files\scilab-5.4.1\modules\call_scilab\examples\call_scilab\c\visual_studio . Then I got an error message at build time complaining about incompatible COFF format that I “solved” by removing the default configuration option to embed the manifest (Manifest tool/input and output/embed=NO ). Then it rebuilds and the exe generated in SCI\bin runs well, in console mode.

Nb: While working on my dlls troubles, I’ve added a new user’s environment variable SCI= C:\Program Files\scilab-5.4.1\bin and added it to the user’s Path environment variable Path=….; C:\Program Files\scilab-5.4.1\bin.
This allow to run Scilab from every local directory without stating the full path and let the system know that there is there a lot of dlls that might be called. Not sure that it should be necessary but that’s the case on my machine.

By the way I’m still puzzling with this strange behavior that as soon as my component (dll) references dependency with call_scilab.dll, my simulation environment fails to see that the expected component is actually inside and the simulation stop even before trying to call Scilab... Arrgh!

Regards,

David


De : quantparis at numericable.fr [mailto:quantparis at numericable.fr]
Envoyé : mercredi 25 septembre 2013 11:41
À : CHEZE David 227480
Objet : Re: [Scilab-users] call_scilab from another dll

Hello David,

I read your post concerning call_scilab, I have been trying to use it on linux with no success up to now

as on one of my disk I have windows 7, yesterday evening I installed studio 2010 and scilab 5.4.1 bin

but unfortunalty I wasn't able to go up to your problem (call_scilab from another dll) because I failed the
simple use of call_scilab

if you have any suggestions it would be helpfull


FIRST ATTEMPT
----------------------------------------------------------------------------------------------------------
I try to run
http://help.scilab.org/docs/5.3.3/en_US/call_scilab.html

in visual studio 2010 pro
Project Properties C/C++
Additional include librarie
c:\Program Files\scilab5.4.1\modules\call_scilab\includes
c:\Program Files\scilab5.4.1\modules\core\includes

Project Properties Linker
general : Additional library Directories
c:\Program Files\scilab5.4.1\bin

input :
api_scilab.lib
call_scilab.lib
core.lib

RESULT: unresolved external TerminateScilab
etc...

note that I get the same linking error when I execute the make file supplied for linux
implementation


SECOND ATTEMPT
------------------------------------------------------------------------------------------------------------------------
try to run the callSciVC project supplied in the scilab installation
scilab5.4.1\modules\call_scilab\examples\c\visual-studio\callsciVC solution

similar results unresolved external



thanks in advance if you have any suggestions

pascal







---- Message d'origine ----
>De : "David Chèze" <david.cheze at cea.fr<mailto:david.cheze at cea.fr>>
>À : users at lists.scilab.org<mailto:users at lists.scilab.org>
>Objet : [Scilab-users] call_scilab from another dll
>Date : 24/09/2013 17:58:10 CEST
>
>Hi,
>
> i'm trying to call Scilab using call_scilab features from a .dll component
> : in the system simulation environment (TRNSYS), components are available
> for the simulation core as dll files (under windows). I'm writing this
> component with microsoft visual c++ 2010 express and it runs well in the
> simulation environment as soon as I don't include in my code real calls to
> call_scilab functions (StartScilab()). Building process is ok since it
> finds the headers and librairies for call_scilab and api_scilab. When I
> include call to StartScilab for example, then the build process is still ok
> but when I try to run my simulation simple test case (1 component), the
> simulation core issues a message that it found the dll file but it didn't
> find any component referenced in the test case diagram, then it failed to
> run the simulation. I guess that when I really call scilab functions from
> my
> components, it changes something in the shape of the file that make it
> uncompatible with the existing kernel dlls.
>
> Did you already succeeded in running similar simulation task under windows
> OS (WIN7 32 Bits) involving dll files that call Scilab ?
> Any ideas to investigate further?
>
> Thanks for your feedback,
>
> David
>
>
>
> --
> View this message in context: http://mailinglists.scilab.org/call-scilab-from
> -another-dll-tp4027456.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at
> Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org<mailto:users at lists.scilab.org>
> http://lists.scilab.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130926/f2e0dba9/attachment.htm>


More information about the users mailing list