Windows 10 VS 2015 example under ilib_build fails pvApiCtx undeclared identifier

classic Classic list List threaded Threaded
6 messages Options
PhilAPol PhilAPol
Reply | Threaded
Open this post in threaded view
|

Windows 10 VS 2015 example under ilib_build fails pvApiCtx undeclared identifier

I am using Visual Studio Express 2015 with C++ and attempted to build the cpp example for a an interface found at page:

https://help.scilab.org/docs/5.4.0/fr_FR/ilib_build.html

I copied the example and pasted it into SciNotes and saved it into cpp_test.sce then executed it. The build produced several errors:

=========================================

exec('C:\Users\Admin\Desktop\cpp_test.sce', -1)
   Generate a gateway file
   Generate a loader file
   Generate a Makefile
   Running the makefile
   Compilation of ilib_build_cpp.cpp
   Compilation of ilib_build_cpp.h
   Compilation of ilib_build_cpp.hxx
   Compilation of sci_cppfind.cxx
   Building shared library (be patient)

!------------- Compile file sci_cppfind.cxx --------------                              !
!                                                                                       !
! IF NOT EXIST  Release mkdir Release                                                   !
!                                                                                       !
!sci_cppfind.cxx                                                                        !
!                                                                                       !
!sci_cppfind.cxx(27): error C2065: 'pvApiCtx': undeclared identifier                    !
!                                                                                       !
!sci_cppfind.cxx(34): error C2065: 'pvApiCtx': undeclared identifier                    !
!                                                                                       !
!sci_cppfind.cxx(47): error C2065: 'pvApiCtx': undeclared identifier                    !
!                                                                                       !
!sci_cppfind.cxx(54): error C2065: 'pvApiCtx': undeclared identifier                    !
!                                                                                       !
!sci_cppfind.cxx(67): error C2065: 'pvApiCtx': undeclared identifier                    !
!                                                                                       !
!sci_cppfind.cxx(81): error C2065: 'pvApiCtx': undeclared identifier                    !
!                                                                                       !
!sci_cppfind.cxx(95): error C2065: 'pvApiCtx': undeclared identifier                    !
!                                                                                       !
!sci_cppfind.cxx(102): error C2065: 'pvApiCtx': undeclared identifier                   !
!                                                                                       !
!sci_cppfind.cxx(116): warning C4244: '=': conversion from 'unsigned __int64' to 'double!
!', possible loss of data                                                               !
!                                                                                       !
!sci_cppfind.cxx(122): error C2065: 'pvApiCtx': undeclared identifier                   !
!                                                                                       !
!sci_cppfind.cxx(129): error C2065: 'pvApiCtx': undeclared identifier                   !
!                                                                                       !
!NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN!
!\amd64\cl.EXE"' : return code '0x2'                                                    !
!                                                                                       !
!Stop.                                                                                  !
at line    36 of function dlwCompile   ( C:\PROGRA~1\SCILAB~1.0-B\modules\dynamic_link\macros\windows\dlwCompile.sci line 49 )
at line    70 of function ilib_compile ( C:\PROGRA~1\SCILAB~1.0-B\modules\dynamic_link\macros\ilib_compile.sci line 86 )
at line   115 of function ilib_build   ( C:\PROGRA~1\SCILAB~1.0-B\modules\dynamic_link\macros\ilib_build.sci line 128 )
at line   147 of executed file C:\Users\Admin\Desktop\cpp_test.sce

ilib_compile: Error while executing Makelib.mak.

====================================

I have not configured any environment variables for includes, etc. since I it wasn't clear how the environment should be configured - I presumed that the SciLab installation with Visual Studio 2015 would set this up properly so that the demos would work.

Please help me find the problem.

Tnx

PhilAPol

Clément David-2 Clément David-2
Reply | Threaded
Open this post in threaded view
|

Re: Windows 10 VS 2015 example under ilib_build fails pvApiCtx undeclared identifier

Hello PhilAPol,

The `pvApiCtx` variable has been introduced to migrate between Scilab 5 and Scilab 6. What Scilab
version are you using ?

--
Clément

Le jeudi 14 juillet 2016 à 17:37 -0700, PhilAPol a écrit :

> I am using Visual Studio Express 2015 with C++ and attempted to build the cpp
> example for a an interface found at page:
>
> https://help.scilab.org/docs/5.4.0/fr_FR/ilib_build.html
>
> I copied the example and pasted it into SciNotes and saved it into
> cpp_test.sce then executed it. The build produced several errors:
>
> =========================================
>
> exec('C:\Users\Admin\Desktop\cpp_test.sce', -1)
>    Generate a gateway file
>    Generate a loader file
>    Generate a Makefile
>    Running the makefile
>    Compilation of ilib_build_cpp.cpp
>    Compilation of ilib_build_cpp.h
>    Compilation of ilib_build_cpp.hxx
>    Compilation of sci_cppfind.cxx
>    Building shared library (be patient)
>
> !------------- Compile file sci_cppfind.cxx --------------                             
> !
> !                                                                                      
> !
> ! IF NOT EXIST  Release mkdir Release                                                  
> !
> !                                                                                      
> !
> !sci_cppfind.cxx                                                                       
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(27): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(34): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(47): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(54): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(67): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(81): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(95): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(102): error C2065: 'pvApiCtx': undeclared identifier                  
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(116): warning C4244: '=': conversion from 'unsigned
> __int64' to 'double!
> !', possible loss of data                                                              
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(122): error C2065: 'pvApiCtx': undeclared identifier                  
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(129): error C2065: 'pvApiCtx': undeclared identifier                  
> !
> !                                                                                      
> !
> !NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
> 14.0\VC\BIN!
> !\amd64\cl.EXE"' : return code '0x2'                                                   
> !
> !                                                                                      
> !
> !Stop.                                                                                 
> !
> at line    36 of function dlwCompile   (
> C:\PROGRA~1\SCILAB~1.0-B\modules\dynamic_link\macros\windows\dlwCompile.sci
> line 49 )
> at line    70 of function ilib_compile (
> C:\PROGRA~1\SCILAB~1.0-B\modules\dynamic_link\macros\ilib_compile.sci line
> 86 )
> at line   115 of function ilib_build   (
> C:\PROGRA~1\SCILAB~1.0-B\modules\dynamic_link\macros\ilib_build.sci line 128
> )
> at line   147 of executed file C:\Users\Admin\Desktop\cpp_test.sce
>
> ilib_compile: Error while executing Makelib.mak.
>
> ====================================
>
> I have not configured any environment variables for includes, etc. since I
> it wasn't clear how the environment should be configured - I presumed that
> the SciLab installation with Visual Studio 2015 would set this up properly
> so that the demos would work.
>
> Please help me find the problem.
>
> Tnx
>
> PhilAPol
>
>
>
>
>
> --
> View this message in context: http://mailinglists.scilab.org/Windows-10-VS-2015-example-under-ilib
> -build-fails-pvApiCtx-undeclared-identifier-tp4034371.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
PhilAPol PhilAPol
Reply | Threaded
Open this post in threaded view
|

RE: Windows 10 VS 2015 example under ilib_build fails pvApiCtx undeclared identifier

Hi Clément,

I am using Scilab 6.0.0-beta-2.

PhilAPol

Date: Tue, 19 Jul 2016 06:12:59 -0700
From: [hidden email]
To: [hidden email]
Subject: Re: Windows 10 VS 2015 example under ilib_build fails pvApiCtx undeclared identifier

Hello PhilAPol,

The `pvApiCtx` variable has been introduced to migrate between Scilab 5 and Scilab 6. What Scilab
version are you using ?

--
Clément

Le jeudi 14 juillet 2016 à 17:37 -0700, PhilAPol a écrit :

> I am using Visual Studio Express 2015 with C++ and attempted to build the cpp
> example for a an interface found at page:
>
> https://help.scilab.org/docs/5.4.0/fr_FR/ilib_build.html
>
> I copied the example and pasted it into SciNotes and saved it into
> cpp_test.sce then executed it. The build produced several errors:
>
> =========================================
>
> exec('C:\Users\Admin\Desktop\cpp_test.sce', -1)
>    Generate a gateway file
>    Generate a loader file
>    Generate a Makefile
>    Running the makefile
>    Compilation of ilib_build_cpp.cpp
>    Compilation of ilib_build_cpp.h
>    Compilation of ilib_build_cpp.hxx
>    Compilation of sci_cppfind.cxx
>    Building shared library (be patient)
>
> !------------- Compile file sci_cppfind.cxx --------------                             
> !
> !                                                                                      
> !
> ! IF NOT EXIST  Release mkdir Release                                                  
> !
> !                                                                                      
> !
> !sci_cppfind.cxx                                                                       
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(27): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(34): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(47): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(54): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(67): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(81): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(95): error C2065: 'pvApiCtx': undeclared identifier                   
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(102): error C2065: 'pvApiCtx': undeclared identifier                  
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(116): warning C4244: '=': conversion from 'unsigned
> __int64' to 'double!
> !', possible loss of data                                                              
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(122): error C2065: 'pvApiCtx': undeclared identifier                  
> !
> !                                                                                      
> !
> !sci_cppfind.cxx(129): error C2065: 'pvApiCtx': undeclared identifier                  
> !
> !                                                                                      
> !
> !NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
> 14.0\VC\BIN!
> !\amd64\cl.EXE"' : return code '0x2'                                                   
> !
> !                                                                                      
> !
> !Stop.                                                                                 
> !
> at line    36 of function dlwCompile   (
> C:\PROGRA~1\SCILAB~1.0-B\modules\dynamic_link\macros\windows\dlwCompile.sci
> line 49 )
> at line    70 of function ilib_compile (
> C:\PROGRA~1\SCILAB~1.0-B\modules\dynamic_link\macros\ilib_compile.sci line
> 86 )
> at line   115 of function ilib_build   (
> C:\PROGRA~1\SCILAB~1.0-B\modules\dynamic_link\macros\ilib_build.sci line 128
> )
> at line   147 of executed file C:\Users\Admin\Desktop\cpp_test.sce
>
> ilib_compile: Error while executing Makelib.mak.
>
> ====================================
>
> I have not configured any environment variables for includes, etc. since I
> it wasn't clear how the environment should be configured - I presumed that
> the SciLab installation with Visual Studio 2015 would set this up properly
> so that the demos would work.
>
> Please help me find the problem.
>
> Tnx
>
> PhilAPol
>
>
>
>
>
> --
> View this message in context: http://mailinglists.scilab.org/Windows-10-VS-2015-example-under-ilib
> -build-fails-pvApiCtx-undeclared-identifier-tp4034371.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users



To unsubscribe from Windows 10 VS 2015 example under ilib_build fails pvApiCtx undeclared identifier, click here.
NAML
Freddos Freddos
Reply | Threaded
Open this post in threaded view
|

Re: Windows 10 VS 2015 example under ilib_build fails pvApiCtx undeclared identifier

How did it go with this one? I just upgraded to Scilab 6.1 (from 5.5.2) and
got the "pvApiCtx: undeclared indentifier" using the "Scilab Engine"
(calling Scilab from my C++ application). All upgrade documentation (5 to 6)
I have found only talks about the API using Gateways (not Scilab Engine),
and the documentation for the call scilab api still has code examples with
the pvApiCtx variable ("Double management" for example). But looking in the
scilab headers it seems to have been removed. So either how do I get the
pvApiCtx variable (?) or how is the right way to read variables from the
Scilab Engine in Scilab 6.x?



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Clément David-3 Clément David-3
Reply | Threaded
Open this post in threaded view
|

Re: Windows 10 VS 2015 example under ilib_build fails pvApiCtx undeclared identifier

Hello,

You are correct, the pvApiCtx global define available in Scilab 5 no more exists in Scilab 6 as described in [1] or [2]. The call_scilab might need to be updated to cover this change, could you please post a bug on that ?

 

[1]: https://cgit.scilab.org/scilab/tree/scilab/CHANGES.md?id=6.0.2#n374

[2]: https://help.scilab.org/docs/6.1.0/en_US/integerExample.html

 

In a sentence, you should add a variable `void* pvApiCtx` on each gateway declaration. This variable will be passed through the Scilab APIs as a context of execution.

 

Thanks,

 

--

Clément


> -----Original Message-----
> From: users <[hidden email]> On Behalf Of Freddos
> Sent: Friday, May 8, 2020 11:19 AM
> To: [hidden email]
> Subject: Re: [Scilab-users] Windows 10 VS 2015 example under ilib_build fails
> pvApiCtx undeclared identifier
>
> How did it go with this one? I just upgraded to Scilab 6.1 (from 5.5.2) and got the
> "pvApiCtx: undeclared indentifier" using the "Scilab Engine"
> (calling Scilab from my C++ application). All upgrade documentation (5 to 6) I
> have found only talks about the API using Gateways (not Scilab Engine), and the
> documentation for the call scilab api still has code examples with the pvApiCtx
> variable ("Double management" for example). But looking in the scilab headers
> it seems to have been removed. So either how do I get the pvApiCtx variable (?)
> or how is the right way to read variables from the Scilab Engine in Scilab 6.x?
>
>
>
> --
> Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-
> f2602246.html
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Freddos Freddos
Reply | Threaded
Open this post in threaded view
|

Re: Windows 10 VS 2015 example under ilib_build fails pvApiCtx undeclared identifier

Hi Clement,

thanks for answering.

You are correct, the pvApiCtx global define available in Scilab 5 no more exists in Scilab 6 as described in [1] or [2]. The call_scilab might need to be updated to cover this change, could you please post a bug on that ?

 
Ah, yes I will, but at the moment I still don't know where the bug is except it seems some documentation is missing (or it's a combination with something I have misunderstood).

In a sentence, you should add a variable `void* pvApiCtx` on each gateway declaration. This variable will be passed through the Scilab APIs as a context of execution.

 
This I found in the documentation, so if I were doing a gateway, then I don't think anything is really missing in the documentation. The problem is I'm running Scilab from my C++ exe file (Scilab Engine instead of Gateway if I understood the naming correctly). In short I did this from my program (using Scilab 5.5.2):
  1. Start up the scilab instance: StartScilab()
  2. Call my script: SendScilabJob()
  3. Read back some variables after the script is done: readNamedMatrixOfDouble( pvApiCtx, ...)
  4. TerminateScilab()
But up until number 3 above, "pvApiCtx" wasn't needed. And I've read some other discussion on this mailing list that you shouldn't mix the old 5.2 stack-style with the new 6.X C++ API style, but that feels exactly what I'm doing!? So I'm guessing I'm actually reading back my variables wrong, but I didn't find any documentation of another way to do it? Sending NULL on pvApiCtx makes the program work (which I found in an example), but is it really the right 6.X way to do it in?

Thanks for any hints

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users