help-octave
[Top][All Lists]
Advanced

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

Re: msys, swig, cmake, and undefined octave dll routines


From: Brad Bell
Subject: Re: msys, swig, cmake, and undefined octave dll routines
Date: Tue, 3 Jan 2017 08:19:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0


On 01/02/2017 06:33 PM, Mike Miller wrote:
On Mon, Jan 02, 2017 at 08:29:18 -0700, Brad Bell wrote:
I am not sure if this is the right list for the question below ?

... snip ...
The python version works under mingw-msys, but I am having some trouble
linking the octave version. For example, I get the message
     swig_exampleOCTAVE_wrap.cxx:912: undefined reference to `
     octave_value::octave_value(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, char)'
Do the only link errors have some reference to
std::__cxx11::basic_string? I don't have access to Windows to verify,
but I think it is correct that these symbols are not in Octave's
liboctave and liboctinterp (at least in Octave 4.0).
I thought that perhaps Octave uses its minor version number for bug fixes, so I advanced to octave-4.0.3 and still got the same error.

Searching the library file to see what is there we have:
nm /c/Octave/Octave-4.0.3/lib/octave/4.0.3/liboctinterp.dll.a > junk
grep 'octave_value.*octave_value' junk | head -1
00000000 I __imp___ZNK20mxArray_octave_value15is_octave_valueEv

So it appears to me that the library contains C++ information about the octave_value class.

I thought perhaps if I compiled with -std=c++98 it would work.
it appears that in this case swig/octave are getting confused about the notstandard symbol M_PI. This seems strange because sig is include oct.h which should get the correct configuration.
To be specific, I get
.../oct-cmplx.h: In function 'bool operator>(const std::complex<_Tp>&, const std::complex<_Tp>&)':
... error: 'M_PI' was not declared in this scope

This seems strange to me because swig is including oct.h first and it appears that it would get the loading of math.h that octave expects.


Are you building your extension module using the gcc provided with
Octave or using a separate mingw-msys development environment?

If you are not using the gcc provided with the Octave 4.0.0 installer,
which gcc version is it?

I am building in a separate msys install with
    cppad_swig.git>gcc --version
    gcc.exe (GCC) 5.3.0
    ...

I should mention that I had to change two include instructions that seem like typos to me
(because the corresponding files could not be found).
To be specific, in oct.h I changed
    #include <config.h>
to
    #include "config.h"
and in comment-list.h I changed
    #include <base-list.h>
to
    #include "base_list.h"




reply via email to

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