Identifying types in the types table.

View: New views
2 Messages — Rating Filter:   Alert me  

Identifying types in the types table.

by Guillaume Yziquel-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello.

I'm still wrapping my C++ code into OCaml. I'm having an issue with
SWIGTYPES. I was getting this

> Exception: Failure "No appropriate conversion found.".

when executing code from the OCaml toploop. The issue seems to be that
types are handled dynamically, and that the std__basic_stringT_char_t is
declared to be different that the string type. Which it really ought not
to be.

The types table is below. How do I tell swig that these two type are in
fact the same?

> /* -------- TYPES TABLE (BEGIN) -------- */
>
> #define SWIGTYPE_p_listT_word_t swig_types[0]
> #define SWIGTYPE_p_std__basic_stringT_char_t swig_types[1]
> #define SWIGTYPE_p_std__basic_stringT_wchar_t_t swig_types[2]
> #define SWIGTYPE_p_string swig_types[3]
> #define SWIGTYPE_p_tokenizer swig_types[4]
> #define SWIGTYPE_p_unsigned_long swig_types[5]
> #define SWIGTYPE_p_wchar_t swig_types[6]
> static swig_type_info *swig_types[8];
> static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0};
> #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
> #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
>
> /* -------- TYPES TABLE (END) -------- */

All the best,

Guillaume Yziquel.

------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

Error with stl_list.h

by Guillaume Yziquel-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Guillaume Yziquel a écrit :
> Hello.
>
> I'm still wrapping my C++ code into OCaml. I'm having an issue with
> SWIGTYPES. I was getting this

OK. Solved. I removed using namespace std to avoid confusions...

But know that I've added %include std_list.i, I get the following error:

> yziquel@seldon:~/svn/main/libmorfo-ocaml$ make 2>& 1 | grep error
> /usr/include/c++/4.3/bits/stl_list.h:1394: error: no match for ‘operator==’ in ‘__i1.std::_List_const_iterator<_Tp>::operator* [with _Tp = analysis]() == __i2.std::_List_const_iterator<_Tp>::operator* [with _Tp = analysis]()’

The freeling.i file I'm using follows below.

What does this error mean?

All the best,

Guillaume Yziquel.

> yziquel@seldon:~/svn/main/libmorfo-ocaml$ cat freeling.i
> %module swig_Freeling
> %{
>   #include "freeling.h"
> %}
>
> %include std_string.i
> %include std_list.i
>
> %template(ListWord) std::list<word>;
>
> // Freeling declarations.
>
> class tokenizer {
>    public:
>        /// Constructor
>        tokenizer(const std::string &);
>
>        /// tokenize string with default options
>        std::list<word> tokenize(const std::string &);
>        /// tokenize string with default options, tracking offset in given int param.
>        std::list<word> tokenize(const std::string &, unsigned long &);
> };


------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user