Re: Typelib fails to compile using Ruby 1.9.2

Ruben Smits <[email protected]>
Newsgroups gmane.science.robotics.orocos.devel
Message-ID <CAN8PhbmRZi3ANF05hV3QwhNcfy+XZK9F_AUgGYjYZ8tNOwJVTw@mail.gmail.com>
Using Ruby 1.9.3 I get the following error:

[ 81%] Building CXX object
bindings/ruby/CMakeFiles/typelib_ruby.dir/ext/memory.o
/Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:45:5:
error: cannot
      initialize a member subobject of type 'int (*)()' with an rvalue of
type 'int (*)(...)'
    (int (*)(...))memory_table_compare,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:46:5:
error: cannot
      initialize a member subobject of type 'int (*)()' with an rvalue of
type 'st_index_t (*)(...)':
      different return type ('int' vs 'st_index_t' (aka 'long'))
    (st_index_t (*)(...))memory_table_hash
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Ruben


On Wed, Sep 11, 2013 at 11:50 AM, Ruben Smits
<[email protected]>wrote:

> Hi,
>
> I'm using Ruby 1.9.2 and when I compile typelib master (using clang on OSX
> 10.8) I get the following error:
>
> [ 72%] Building CXX object
> bindings/ruby/CMakeFiles/typelib_ruby.dir/ext/memory.o
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:35:8:
> error: unknown type
>       name 'st_index_t'
> static st_index_t memory_table_hash(void* a)
>        ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:39:13:
> error: use of
>       undeclared identifier 'st_index_t'
>     return (st_index_t)a;
>             ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:45:19:
> error: expected
>       expression
>     (st_index_t (*)(...))memory_table_hash
>                   ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:45:21:
> error: expected
>       expression
>     (st_index_t (*)(...))memory_table_hash
>                     ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:43:28:
> error: variable has
>       incomplete type 'struct st_hash_type'
> static struct st_hash_type memory_table_type = {
>                            ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:43:15:
> note: forward
>       declaration of 'st_hash_type'
> static struct st_hash_type memory_table_type = {
>               ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:119:33:
> error: use of
>       undeclared identifier 'st_data_t'
>     if (st_lookup(MemoryTable, (st_data_t)ptr, (st_data_t*)&entry))
>                                 ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:146:34:
> error: use of
>       undeclared identifier 'st_data_t'
>     if (!st_lookup(MemoryTable, (st_data_t)ptr, (st_data_t*)&entry))
>                                  ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:160:33:
> error: use of
>       undeclared identifier 'st_data_t'
>         st_delete(MemoryTable, (st_data_t*)&ptr, 0);
>                                 ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:160:43:
> error: expected
>       expression
>         st_delete(MemoryTable, (st_data_t*)&ptr, 0);
>                                           ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:200:34:
> error: use of
>       undeclared identifier 'st_data_t'
>     if (!st_lookup(MemoryTable, (st_data_t)ptr, (st_data_t*)&entry)) {
>                                  ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:221:33:
> error: use of
>       undeclared identifier 'st_data_t'
>         st_insert(MemoryTable, (st_data_t)ptr, (st_data_t)entry);
>                                 ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:226:42:
> error: use of
>       undeclared identifier 'st_data_t'
>             if (!st_lookup(MemoryTable, (st_data_t)root_ptr,
> (st_data_t*)&root_entry))
>                                          ^
> /Users/vm/orocos_ws/src/orocos_toolchain/typelib/bindings/ruby/ext/memory.cc:369:31:
> error: member access
>       into incomplete type 'st_table'
>     return INT2NUM(MemoryTable->num_entries);
>                               ^
> /System/Library/Frameworks/Ruby.framework/Headers/ruby.h:147:32: note:
> expanded from macro 'INT2NUM'
> #define INT2NUM(v) rb_int2inum(v)
>                                ^
> /System/Library/Frameworks/Ruby.framework/Headers/ruby.h:335:12: note:
> forward declaration of 'st_table'
>     struct st_table *iv_tbl;
>
> Ruben
>
> --
> Ruben Smits, Phd
> Chief Technology Officer
> Intermodalics BVBA
> +32479511786
> www.intermodalics.eu
>



-- 
Ruben Smits, Phd
Chief Technology Officer
Intermodalics BVBA
+32479511786
www.intermodalics.eu

-- 
Orocos-Dev mailing list
[email protected]
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.