help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

invalid type conversion when using C++ API


From: lqj1990
Subject: invalid type conversion when using C++ API
Date: Sun, 27 May 2018 15:45:57 -0700 (MST)

Hi all,

I'm new to Octave. I want to use some function in Octave using C++ API.
When I follow the tutorial
https://octave.org/doc/interpreter/Standalone-Programs.html (A.3), I
encounter an invalid type conversion problem.

The compiler shows that:
Severity        Code    Description     Project File    Line    Suppression 
State
Error   C2440   'static_cast': cannot convert from 'octave_idx_type *' to 'long
*'      TestOctaveStandAlone
c:\octave\octave-4.4.0\include\octave-4.4.0\octave\dim-vector.h 156     

The problem is located in oct-refcount.h, for the functions:
OCTAVE_ATOMIC_INCREMENT, OCTAVE_ATOMIC_DECREMENT,
OCTAVE_ATOMIC_POST_INCREMENT, OCTAVE_ATOMIC_POST_DECREMENT, in which a
variable x is converted from  octave_idx_type* to long*.

How can I resolve the problem?
I'm using VS2017, the compiler configuration is Debug, x64.
The Octave version is 4.4.0.

Thank you



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]