[Kde-bindings] is it possible to use qtruby4 with ruby 1.9?

Stefano Crocco stefano.crocco at alice.it
Sun Feb 8 12:29:04 UTC 2009


Alle Thursday 05 February 2009, Richard Dale ha scritto:
> Yes, I'm using the same Smoke libraries with both Ruby 1.8.7 and 1.9.1. But
> we have changed Smoke over the last year quite a bit, and so you need to
> make sure that you have regenerated the libs from whichever version of the
> Qt and KDE headers that you are using.

Following your suggestion, I tried to make sure to have everything up to date. 
After installing the latest SVN revision of KDE, I did the following:

- removed all things related to qtruby4/korundum4 both with a make uninstall 
and with a manual search for pieces which could have remained behind
- removed the kdebindings source trees and the build directories
- checked out the latest svn revision of kdebindings
- created a build directory for the 1.8 version of qtruby
- cd in the build directory
- run cmake then ccmake to change the install prefix from /usr/local to 
/usr/kde/svn
- run make and make install

This installed a completely working qtruby4/korundum4 for ruby 1.8 (in 
/usr/lib/ruby/site_ruby/1.8/). It also installed smoke in /usr/kde/svn/lib.

I then did the following to build the bindings for ruby 1.9:
- created a build directory (different from the one for ruby 1.8)
- cd in the build directory
- run cmake
- with ccmake, changed the following things:
 * disabled smoke (hoping to force linking with the already installed smoke)
 * changed the installation prefix to /usr/kde/svn
 * set the CUSTOM_RUBY_SITE_ARCH_DIR and CUSTOM_RUBY_SITE_LIB_DIR to
   /usr/local/lib/ruby19/site_ruby/1.9.1/i686-linux and 
   /usr/local/lib/ruby19/site_ruby/1.9.1/ respectively
 * changed the RUBY_EXECUTABLE variable to /usr/local/bin/ruby19
 * changed the RUBY_INCLUDE_PATH variable to /usr/local/include/ruby19-1.9.1
 * changed the RUBY_LIBRARY variable to /usr/local/lib/ruby19.so
- issued the make command
The result was a linking error, with the message included in the 
qtruby_compile_error attachment.

I tried copying the lib directory from the compilation of the 1.8 version to 
the build directory for the 1.9 version, but nothing changed.

To make the version for ruby 1.9 compile, I needed to also compile smoke. 
After installing it, however, the 1.8 version stopped working.

The command ruby -rQt4 -e 'Qt::Application.new []' produced a crash. The 
backtrace, from gdb, is in the crash1 attachment.

As I already said in my previous mail, I suspected that some library for the 
1.9 version was loaded from the 1.8 version, so I tried changing my 
LD_LIBRARY_PATH and LDPATH to make /usr/lib come before /usr/local/lib. Then I 
tried: the previous command. The result was:

/usr/lib/ruby/site_ruby/1.8/i686-linux/qtruby4.so: 
/usr/kde/svn/lib/libqtruby4shared.so.2: undefined symbol: _ZN5Smoke8classMapE 
- /usr/lib/ruby/site_ruby/1.8/i686-linux/qtruby4.so (LoadError)
        from /usr/lib/ruby/site_ruby/1.8/Qt.rb:1

This happens with qt-4.4.2, the latest svn revisions of kde and kdebindings,
ruby-1.8.7-p72, ruby-1.9.1-p0 and gcc 4.3.3.

I can't understand what's happening. Do you have any suggestion?

Thanks

Stefano


-------------- next part --------------
Linking CXX shared library ../../../lib/libqtruby4shared.so
CMakeFiles/qtruby4shared.dir/Qt.o: In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*> > >::_M_begin()':
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include/g++-v4/bits/stl_tree.h:453: undefined reference to `Smoke::classMap'
CMakeFiles/qtruby4shared.dir/Qt.o: In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*> > >::_M_end()':
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include/g++-v4/bits/stl_tree.h:464: undefined reference to `Smoke::classMap'
CMakeFiles/qtruby4shared.dir/Qt.o: In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*> > >::_M_begin()':
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include/g++-v4/bits/stl_tree.h:453: undefined reference to `Smoke::classMap'
CMakeFiles/qtruby4shared.dir/Qt.o: In function `std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Smoke*, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*> > >::insert(std::_Rb_tree_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Smoke*> const&)':
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include/g++-v4/bits/stl_map.h:496: undefined reference to `Smoke::classMap'
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include/g++-v4/bits/stl_map.h:496: undefined reference to `Smoke::classMap'
CMakeFiles/qtruby4shared.dir/Qt.o:/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include/g++-v4/bits/stl_tree.h:453: more undefined references to `Smoke::classMap' follow
collect2: ld returned 1 exit status
-------------- next part --------------
#0  0xb7f935fb in st_lookup (table=0x0, key=3213810260, value=0xbf8eda68) at st.c:250
#1  0xb68cb3e1 in rb_intern3 (name=0xb75f7ec3 "new", len=3, enc=0x818e3b0) at parse.y:9394
#2  0xb68cba01 in rb_intern2 (name=0xb75f7ec3 "new", len=3) at parse.y:9493               
#3  0xb75b7dc6 in findMethod (c_value=3058105960, name_value=3057092280) at /home/stefano/temp/kdebindings/ruby/qtruby/src/Qt.cpp:508
#4  0xb7f2a1fb in call_cfunc (func=0xb75b75c0 <findMethod(unsigned long, unsigned long, unsigned long)>, recv=3083942380, len=0, argc=2, argv=0xbf8eda54) at eval.c:5758
#5  0xb7f35018 in rb_call0 (klass=3083941500, recv=3083942380, id=11177, oid=11177, argc=2, argv=0xbf8edf20, body=0xb7d13078, flags=<value optimized out>) at eval.c:5904
#6  0xb7f35159 in rb_call (klass=3083941500, recv=3083942380, mid=11177, argc=2, argv=0xbf8edf20, scope=1, self=3083942380) at eval.c:6151
#7  0xb7f2fbe1 in rb_eval (self=3083942380, n=<value optimized out>) at eval.c:3507
#8  0xb7f32288 in rb_eval (self=3083942380, n=<value optimized out>) at eval.c:3487
#9  0xb7f336e8 in rb_yield_0 (val=3057092280, self=3083942380, klass=0, flags=<value optimized out>, avalue=0) at eval.c:5077
#10 0xb7f3e2f4 in rb_yield (val=3057092280) at eval.c:5161
#11 0xb7f15319 in rb_ary_collect (ary=3057092300) at array.c:1838
#12 0xb7f2a21a in call_cfunc (func=0xb7f152cf <rb_ary_collect>, recv=3057092300, len=0, argc=0, argv=0xbf8eda54) at eval.c:5752
#13 0xb7f35018 in rb_call0 (klass=3083984420, recv=3057092300, id=3785, oid=3785, argc=0, argv=0x0, body=0xb7d1d780, flags=<value optimized out>) at eval.c:5904
#14 0xb7f35159 in rb_call (klass=3083984420, recv=3057092300, mid=3785, argc=0, argv=0x0, scope=0, self=3083942380) at eval.c:6151
#15 0xb7f2fab6 in rb_eval (self=3083942380, n=<value optimized out>) at eval.c:3492
#16 0xb7f32e4d in rb_eval (self=3083942380, n=<value optimized out>) at eval.c:3222
#17 0xb7f34ef9 in rb_call0 (klass=3083941500, recv=3083942380, id=14633, oid=14633, argc=6, argv=0xbf8efa60, body=0xb648766c, flags=<value optimized out>) at eval.c:6055
#18 0xb7f35159 in rb_call (klass=3083941500, recv=3083942380, mid=14633, argc=6, argv=0xbf8efa60, scope=1, self=6) at eval.c:6151
#19 0xb7f35a35 in rb_funcall2 (recv=0, mid=14633, argc=6, argv=0xbf8efa60) at eval.c:6287
#20 0xb7cdb05d in initialize_qt (argc=2, argv=0xbf8efe40, self=3057092700) at /home/stefano/temp/kdebindings/ruby/qtruby/src/qtruby.cpp:1287
#21 0xb7f2a235 in call_cfunc (func=0xb7cdadf0 <initialize_qt>, recv=3057092700, len=0, argc=2, argv=0xbf8eda54) at eval.c:5749
#22 0xb7f35018 in rb_call0 (klass=3083942320, recv=3057092700, id=2961, oid=2961, argc=2, argv=0xbf8efe40, body=0xb7d13910, flags=<value optimized out>) at eval.c:5904
#23 0xb7f35159 in rb_call (klass=3083942320, recv=3057092700, mid=2961, argc=2, argv=0xbf8efe40, scope=3, self=6) at eval.c:6151
#24 0xb7f3d87a in rb_call_super (argc=2, argv=0xbf8efe40) at eval.c:6319
#25 0xb7f2fd47 in rb_eval (self=3057092700, n=<value optimized out>) at eval.c:3558
#26 0xb7f34ef9 in rb_call0 (klass=3058135680, recv=3057092700, id=2961, oid=2961, argc=1, argv=0xbf8f0830, body=0xb7d06bd4, flags=<value optimized out>) at eval.c:6055
#27 0xb7f3da45 in method_call (argc=1, argv=0xbf8f0830, method=3057092640) at eval.c:9537
#28 0xb7f2a235 in call_cfunc (func=0xb7f3d9b4 <method_call>, recv=3057092640, len=0, argc=1, argv=0xbf8eda54) at eval.c:5749
#29 0xb7f35018 in rb_call0 (klass=3083949400, recv=3057092640, id=5521, oid=5521, argc=1, argv=0xbf8f0830, body=0xb7d154b8, flags=<value optimized out>) at eval.c:5904
#30 0xb7f35159 in rb_call (klass=3083949400, recv=3057092640, mid=5521, argc=1, argv=0xbf8f0830, scope=0, self=3083942380) at eval.c:6151
#31 0xb7f2fab6 in rb_eval (self=3083942380, n=<value optimized out>) at eval.c:3492
#32 0xb7f336e8 in rb_yield_0 (val=3741966, self=3083942380, klass=0, flags=<value optimized out>, avalue=0) at eval.c:5077
#33 0xb7f3e134 in rb_f_catch (dmy=3083942380, tag=3741966) at eval.c:13531
#34 0xb7f2a20b in call_cfunc (func=0xb7f3e01a <rb_f_catch>, recv=3083942380, len=0, argc=1, argv=0xbf8eda54) at eval.c:5755
#35 0xb7f35018 in rb_call0 (klass=3084016800, recv=3083942380, id=4185, oid=4185, argc=1, argv=0xbf8f14c0, body=0xb7d23b6c, flags=<value optimized out>) at eval.c:5904
#36 0xb7f35159 in rb_call (klass=3084016800, recv=3083942380, mid=4185, argc=1, argv=0xbf8f14c0, scope=1, self=3083942380) at eval.c:6151
#37 0xb7f2fbe1 in rb_eval (self=3083942380, n=<value optimized out>) at eval.c:3507
#38 0xb7f32e4d in rb_eval (self=3083942380, n=<value optimized out>) at eval.c:3222
#39 0xb7f34ef9 in rb_call0 (klass=3083941500, recv=3083942380, id=14593, oid=14593, argc=2, argv=0xbf8f2030, body=0xb648842c, flags=<value optimized out>) at eval.c:6055
#40 0xb7f35159 in rb_call (klass=3083941500, recv=3083942380, mid=14593, argc=2, argv=0xbf8f2030, scope=1, self=6) at eval.c:6151
#41 0xb7f35a35 in rb_funcall2 (recv=0, mid=14593, argc=2, argv=0xbf8f2030) at eval.c:6287
#42 0xb7cdab16 in new_qt (argc=1, argv=0xbf8f2380, klass=3058135680) at /home/stefano/temp/kdebindings/ruby/qtruby/src/qtruby.cpp:1336
#43 0xb7f2a235 in call_cfunc (func=0xb7cdaa90 <new_qt>, recv=3058135680, len=0, argc=1, argv=0xbf8eda54) at eval.c:5749
#44 0xb7f35018 in rb_call0 (klass=3083942300, recv=3058135680, id=3361, oid=3361, argc=1, argv=0xbf8f2380, body=0xb7d13938, flags=<value optimized out>) at eval.c:5904
#45 0xb7f35159 in rb_call (klass=3083942300, recv=3058135680, mid=3361, argc=1, argv=0xbf8f2380, scope=0, self=3084011860) at eval.c:6151
#46 0xb7f2fab6 in rb_eval (self=3084011860, n=<value optimized out>) at eval.c:3492
#47 0xb7f407a3 in ruby_exec_internal () at eval.c:1641
#48 0xb7f407e3 in ruby_exec () at eval.c:1661
#49 0xb7f40818 in ruby_run () at eval.c:1671
#50 0x080487a5 in main (argc=8398853, argv=0xb7d23400, envp=0x3) at main.c:48


More information about the Kde-bindings mailing list