# Qtruby compilation error

**URL:** <https://rubytalk.org/t/qtruby-compilation-error/12550>\
**Category:** ruby-talk\
**Created:** [13 July 2004 16:40 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550 "2004-07-13T16:40:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jochen\_Immendorfer](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Jochen\_Immendorfer](https://rubytalk.org/u/Jochen_Immendorfer)\
**Post date:** [13 July 2004 16:40 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/1 "2004-07-13T16:40:23Z")

</div>

Hi,

I am trying to compile qtruby. Unfortunally it failed with the following error  
message:

Qt.cpp: In function `VALUE initialize\_qt(int, VALUE\*, VALUE)':  
Qt.cpp:1145: error: ISO C++ forbids cast to non-reference type used as lvalue  
make[5]: \*\*\* [Qt.lo] Fehler 1

Maybe this is due to the gcc version I am using? It's gcc 3.4.1. Well, I  
thought I'll give it a try on my other box running slackware 10.0 with gcc  
3.3.4. But here, ./configure can't find my X includes -- I tried to pass an  
option to point there directly, but still the same. Maybe this is since  
slackware 10.0 ships with x11-6.7.0? Hm, I thought it should be compatible to  
XF86...

Has anyone managed to compile qtruby? Any idea how I could do it as well?

regards,  
jochen

---

<div class="post-metadata">

**Author:** ![Hans\_Fugal6](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@Hans\_Fugal6](https://rubytalk.org/u/Hans_Fugal6)\
**Post date:** [13 July 2004 17:12 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/2 "2004-07-13T17:12:21Z")

</div>

I'm afraid I'm not much help as I didn't get this error, but I was able to compile it. Debian sarge.

Jochen Immendörfer wrote:

> **···**
>
> > Hi,
> > 
> > I am trying to compile qtruby. Unfortunally it failed with the following error message:
> > 
> > Qt.cpp: In function `VALUE initialize\_qt(int, VALUE\*, VALUE)':  
> > Qt.cpp:1145: error: ISO C++ forbids cast to non-reference type used as lvalue  
> > make[5]: \*\*\* [Qt.lo] Fehler 1
> > 
> > Maybe this is due to the gcc version I am using? It's gcc 3.4.1. Well, I thought I'll give it a try on my other box running slackware 10.0 with gcc 3.3.4. But here, ./configure can't find my X includes -- I tried to pass an option to point there directly, but still the same. Maybe this is since slackware 10.0 ships with x11-6.7.0? Hm, I thought it should be compatible to XF86...
> > 
> > Has anyone managed to compile qtruby? Any idea how I could do it as well?
> > 
> > regards,  
> > jochen

---

<div class="post-metadata">

**Author:** ![Paul\_Brannan](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@Paul\_Brannan](https://rubytalk.org/u/Paul_Brannan)\
**Post date:** [13 July 2004 17:14 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/3 "2004-07-13T17:14:55Z")

</div>

I'm not a qtruby developer and I don't have Qt 3.2, so I can't check any  
of this, but it looks like a bug.

Lines 1144-1145 read:

&nbsp;&nbsp;smokeruby\_object \* p = 0;  
&nbsp;&nbsp;&nbsp;&nbsp;Data\_Get\_Struct(temp\_obj, smokeruby\_object, (void \*) p);

And this expands to:

&nbsp;&nbsp;smokeruby\_object \* p = 0;  
&nbsp;&nbsp;Check\_Type(temp\_obj, T\_DATA); (void \*) p = (smokeruby\_object\*)DATA\_PTR(temp\_obj);

Which is not valid C++ (older versions of g++ accept it, but neither  
como nor g++ 3.4 does).

There's really no good reason I can think of for the cast to void\*,  
anyway. You should submit a bug report.

Paul

> **···**
>
> On Wed, Jul 14, 2004 at 01:40:23AM +0900, Jochen Immendörfer wrote:
> 
> > Hi,
> > 
> > I am trying to compile qtruby. Unfortunally it failed with the following error  
> > message:
> > 
> > Qt.cpp: In function `VALUE initialize\_qt(int, VALUE\*, VALUE)':  
> > Qt.cpp:1145: error: ISO C++ forbids cast to non-reference type used as lvalue  
> > make[5]: \*\*\* [Qt.lo] Fehler 1

---

<div class="post-metadata">

**Author:** ![Jochen\_Immendorfer](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Jochen\_Immendorfer](https://rubytalk.org/u/Jochen_Immendorfer)\
**Post date:** [13 July 2004 17:32 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/4 "2004-07-13T17:32:36Z")

</div>

Thank you two for answering.

I already had the intention of submitting a bug report, but -- I just couldn't  
find such a possibility at rubyforge. Am I just blind? If you know where to  
submit a bug report, please tell me and I'll do.

Btw. I removed the cast to void\* from line 1145 and it did actually compile  
after then..

But trying

require 'Qt'

in irb produces a segmentation fault ☹

regards,  
jochen

> **···**
>
> Am Dienstag 13 Juli 2004 19:14 schrieb Paul Brannan:
> 
> > On Wed, Jul 14, 2004 at 01:40:23AM +0900, Jochen Immendörfer wrote:  
> > \> Hi,  
> > \>  
> > \> I am trying to compile qtruby. Unfortunally it failed with the following  
> > \> error message:  
> > \>  
> > \> Qt.cpp: In function `VALUE initialize\_qt(int, VALUE\*, VALUE)':  
> > \> Qt.cpp:1145: error: ISO C++ forbids cast to non-reference type used as  
> > \> lvalue make[5]: \*\*\* [Qt.lo] Fehler 1
> > 
> > I'm not a qtruby developer and I don't have Qt 3.2, so I can't check any  
> > of this, but it looks like a bug.
> > 
> > Lines 1144-1145 read:
> > 
> > &nbsp;&nbsp;smokeruby\_object \* p = 0;  
> > &nbsp;&nbsp;&nbsp;&nbsp;Data\_Get\_Struct(temp\_obj, smokeruby\_object, (void \*) p);
> > 
> > And this expands to:
> > 
> > &nbsp;&nbsp;smokeruby\_object \* p = 0;  
> > &nbsp;&nbsp;Check\_Type(temp\_obj, T\_DATA); (void \*) p =  
> > (smokeruby\_object\*)DATA\_PTR(temp\_obj);
> > 
> > Which is not valid C++ (older versions of g++ accept it, but neither  
> > como nor g++ 3.4 does).
> > 
> > There's really no good reason I can think of for the cast to void\*,  
> > anyway. You should submit a bug report.
> > 
> > Paul

---

<div class="post-metadata">

**Author:** ![Jochen\_Immendorfer](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Jochen\_Immendorfer](https://rubytalk.org/u/Jochen_Immendorfer)\
**Post date:** [13 July 2004 17:54 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/5 "2004-07-13T17:54:22Z")

</div>

Ok, I did one more try. This time on my notebook -- same distribution like  
before same gcc version (Arch Linux, gcc 3.4.1). Cast to void\* removed from  
line 1145. Here it worked. Without segmentation fault. Nice. But I still  
don't know where to submit a bug report 😉

regards,  
jochen

> **···**
>
> Am Dienstag 13 Juli 2004 19:32 schrieb Jochen Immendörfer:
> 
> > Thank you two for answering.
> > 
> > I already had the intention of submitting a bug report, but -- I just  
> > couldn't find such a possibility at rubyforge. Am I just blind? If you know  
> > where to submit a bug report, please tell me and I'll do.
> > 
> > Btw. I removed the cast to void\* from line 1145 and it did actually compile  
> > after then..
> > 
> > But trying
> > 
> > require 'Qt'
> > 
> > in irb produces a segmentation fault ☹
> > 
> > regards,  
> > jochen
> > 
> > Am Dienstag 13 Juli 2004 19:14 schrieb Paul Brannan:  
> > \> On Wed, Jul 14, 2004 at 01:40:23AM +0900, Jochen Immendörfer wrote:  
> > \> \> Hi,  
> > \> \>  
> > \> \> I am trying to compile qtruby. Unfortunally it failed with the  
> > \> \> following error message:  
> > \> \>  
> > \> \> Qt.cpp: In function `VALUE initialize\_qt(int, VALUE\*, VALUE)':  
> > \> \> Qt.cpp:1145: error: ISO C++ forbids cast to non-reference type used as  
> > \> \> lvalue make[5]: \*\*\* [Qt.lo] Fehler 1  
> > \>  
> > \> I'm not a qtruby developer and I don't have Qt 3.2, so I can't check any  
> > \> of this, but it looks like a bug.  
> > \>  
> > \> Lines 1144-1145 read:  
> > \>  
> > \> smokeruby\_object \* p = 0;  
> > \> Data\_Get\_Struct(temp\_obj, smokeruby\_object, (void \*) p);  
> > \>  
> > \> And this expands to:  
> > \>  
> > \> smokeruby\_object \* p = 0;  
> > \> Check\_Type(temp\_obj, T\_DATA); (void \*) p =  
> > \> (smokeruby\_object\*)DATA\_PTR(temp\_obj);  
> > \>  
> > \> Which is not valid C++ (older versions of g++ accept it, but neither  
> > \> como nor g++ 3.4 does).  
> > \>  
> > \> There's really no good reason I can think of for the cast to void\*,  
> > \> anyway. You should submit a bug report.  
> > \>  
> > \> Paul

---

<div class="post-metadata">

**Author:** ![Alexander\_Kellett2](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Alexander\_Kellett2](https://rubytalk.org/u/Alexander_Kellett2)\
**Post date:** [13 July 2004 18:24 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/6 "2004-07-13T18:24:31Z")

</div>

whats the backtrace?

cheers,  
Alex

> **···**
>
> On Wed, Jul 14, 2004 at 02:32:36AM +0900, Jochen Immend?rfer wrote:
> 
> > require 'Qt'
> > 
> > in irb produces a segmentation fault ☹

---

<div class="post-metadata">

**Author:** ![Alexander\_Kellett2](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Alexander\_Kellett2](https://rubytalk.org/u/Alexander_Kellett2)\
**Post date:** [13 July 2004 18:26 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/7 "2004-07-13T18:26:35Z")

</div>

umm you could submit them to me i guess 🙂 (or kde-bindings@kde.org)  
any difference between the two installs? one has a kde install the other not?

Alex

> **···**
>
> On Wed, Jul 14, 2004 at 02:54:22AM +0900, Jochen Immend?rfer wrote:
> 
> > Ok, I did one more try. This time on my notebook -- same distribution like  
> > before same gcc version (Arch Linux, gcc 3.4.1). Cast to void\* removed from  
> > line 1145. Here it worked. Without segmentation fault. Nice. But I still  
> > don't know where to submit a bug report 😉

---

<div class="post-metadata">

**Author:** ![Jochen\_Immendorfer](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Jochen\_Immendorfer](https://rubytalk.org/u/Jochen_Immendorfer)\
**Post date:** [13 July 2004 18:29 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/8 "2004-07-13T18:29:33Z")

</div>

irb(main):001:0\> require 'Qt'  
/usr/lib/ruby/site\_ruby/1.8/i686-linux/qtruby.so: [BUG] Segmentation fault  
ruby 1.8.2 (2004-07-10) [i686-linux]

Speicherzugriffsfehler

That's all I get. (for those who don't understand german:  
Speicherzugriffsfehler means segmentation fault)

> **···**
>
> Am Dienstag 13 Juli 2004 20:24 schrieb Alexander Kellett:
> 
> > On Wed, Jul 14, 2004 at 02:32:36AM +0900, Jochen Immend?rfer wrote:  
> > \> require 'Qt'  
> > \>  
> > \> in irb produces a segmentation fault ☹
> > 
> > whats the backtrace?
> > 
> > cheers,  
> > Alex

---

<div class="post-metadata">

**Author:** ![Jochen\_Immendorfer](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Jochen\_Immendorfer](https://rubytalk.org/u/Jochen_Immendorfer)\
**Post date:** [13 July 2004 18:37 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/9 "2004-07-13T18:37:06Z")

</div>

ok, should I still submit a report to you or did you already hear about  
it? ;))

Both machines have a minimal kde installation. I think both installs should be  
very similar. At least the important packages are the same. Same version  
everywhere. kde version is 3.2.3, qt is 3.3.2.

Do you need more informations?

regards,  
jochen

> **···**
>
> Am Dienstag 13 Juli 2004 20:26 schrieb Alexander Kellett:
> 
> > On Wed, Jul 14, 2004 at 02:54:22AM +0900, Jochen Immend?rfer wrote:  
> > \> Ok, I did one more try. This time on my notebook -- same distribution  
> > \> like before same gcc version (Arch Linux, gcc 3.4.1). Cast to void\*  
> > \> removed from line 1145. Here it worked. Without segmentation fault. Nice.  
> > \> But I still don't know where to submit a bug report 😉
> > 
> > umm you could submit them to me i guess 🙂 (or kde-bindings@kde.org)  
> > any difference between the two installs? one has a kde install the other  
> > not?
> > 
> > Alex

---

<div class="post-metadata">

**Author:** ![Alexander\_Kellett2](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Alexander\_Kellett2](https://rubytalk.org/u/Alexander_Kellett2)\
**Post date:** [13 July 2004 18:37 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/10 "2004-07-13T18:37:49Z")

</div>

can you run in gdb?  
backtrace is reallllly needed

Alex

> **···**
>
> On Wed, Jul 14, 2004 at 03:29:33AM +0900, Jochen Immend?rfer wrote:
> 
> > irb(main):001:0\> require 'Qt'  
> > /usr/lib/ruby/site\_ruby/1.8/i686-linux/qtruby.so: [BUG] Segmentation fault  
> > ruby 1.8.2 (2004-07-10) [i686-linux]
> > 
> > Speicherzugriffsfehler
> > 
> > That's all I get. (for those who don't understand german:  
> > Speicherzugriffsfehler means segmentation fault)

---

<div class="post-metadata">

**Author:** ![Jochen\_Immendorfer](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Jochen\_Immendorfer](https://rubytalk.org/u/Jochen_Immendorfer)\
**Post date:** [13 July 2004 18:41 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/11 "2004-07-13T18:41:56Z")

</div>

hm.. I'm sorry to say so, but I don't now how to do this. If you tell me what  
I exactly have to do, I'll give my best 😉

> **···**
>
> > can you run in gdb?  
> > backtrace is reallllly needed
> > 
> > Alex

---

<div class="post-metadata">

**Author:** ![Alexander\_Kellett2](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Alexander\_Kellett2](https://rubytalk.org/u/Alexander_Kellett2)\
**Post date:** [13 July 2004 18:57 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/12 "2004-07-13T18:57:13Z")

</div>

no thats okay. with the backtrace i should be able to figure out  
whats wrong. and if i already know the fix or not 🙂 there is a  
workaround for a pthread related backtrace available but i didn't  
port this to the qtruby only version for the moment.

Alex

> **···**
>
> On Wed, Jul 14, 2004 at 03:37:06AM +0900, Jochen Immend?rfer wrote:
> 
> > Both machines have a minimal kde installation. I think both installs should be  
> > very similar. At least the important packages are the same. Same version  
> > everywhere. kde version is 3.2.3, qt is 3.3.2.
> > 
> > Do you need more informations?

---

<div class="post-metadata">

**Author:** ![Alexander\_Kellett2](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Alexander\_Kellett2](https://rubytalk.org/u/Alexander_Kellett2)\
**Post date:** [13 July 2004 19:04 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/13 "2004-07-13T19:04:36Z")

</div>

start gdb with:  
&nbsp;&nbsp;&nbsp;gdb ruby  
then try  
&nbsp;&nbsp;&nbsp;run -e "require 'Qt'"  
can't test... don't have a working x11 installation :s  
but it should work if i remember gdb correctly 😛  
Alex

> **···**
>
> On Wed, Jul 14, 2004 at 03:41:56AM +0900, Jochen Immend?rfer wrote:
> 
> > hm.. I'm sorry to say so, but I don't now how to do this. If you tell me what  
> > I exactly have to do, I'll give my best 😉
> > 
> > \>  
> > \> can you run in gdb?  
> > \> backtrace is reallllly needed  
> > \>  
> > \> Alex

---

<div class="post-metadata">

**Author:** ![Jochen\_Immendorfer](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Jochen\_Immendorfer](https://rubytalk.org/u/Jochen_Immendorfer)\
**Post date:** [13 July 2004 19:19 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/14 "2004-07-13T19:19:07Z")

</div>

Ok, I must confess I have not much experience in using gdb, but here is what I  
get:

$ gdb ruby

(gdb) run -e "require 'Qt'"  
Starting program: /usr/bin/ruby -e "require 'Qt'"  
(no debugging symbols found)...(no debugging symbols found)...(no debugging  
symbols found)...(no debugging symbols found)...(no debugging symbols  
found)...(no debugging symbols found)...(no debugging symbols found)...(no  
debugging symbols found)...(no debugging symbols found)...(no debugging  
symbols found)...(no debugging symbols found)...(no debugging symbols  
found)...(no debugging symbols found)...(no debugging symbols found)...(no  
debugging symbols found)...(no debugging symbols found)...(no debugging  
symbols found)...(no debugging symbols found)...(no debugging symbols  
found)...(no debugging symbols found)...(no debugging symbols found)...(no  
debugging symbols found)...(no debugging symbols found)...[Thread debugging  
using libthread\_db enabled]  
[New Thread 16384 (LWP 20408)]  
(no debugging symbols found)...(no debugging symbols found)...(no debugging  
symbols found)...(no debugging symbols found)...(no debugging symbols  
found)...(no debugging symbols found)...(no debugging symbols found)...  
Program received signal SIGSEGV, Segmentation fault.  
[Switching to Thread 16384 (LWP 20408)]  
0x40fd86f9 in \_\_pthread\_unlock () from /lib/libpthread.so.0  
(gdb)  
(gdb) backtrace  
#0 0x40fd86f9 in \_\_pthread\_unlock () from /lib/libpthread.so.0  
#1 0x40fd5d15 in pthread\_mutex\_unlock () from /lib/libpthread.so.0  
#2 0x40242a5b in \_dl\_open () from /lib/libc.so.6  
#3 0x400ebe8b in dlopen\_doit () from /lib/libdl.so.2  
#4 0x4000ad76 in \_dl\_catch\_error\_internal () from /lib/ld-linux.so.2  
#5 0x400ec276 in \_dlerror\_run () from /lib/libdl.so.2  
#6 0x400ebed4 in dlopen@@GLIBC\_2.1 () from /lib/libdl.so.2  
#7 0x40041e07 in dln\_load () from /usr/lib/libruby.so.1.8  
#8 0x4005b48e in rb\_require\_safe () from /usr/lib/libruby.so.1.8  
#9 0x0000002e in ?? ()  
#10 0x00000000 in ?? ()  
#11 0x00000000 in ?? ()  
#12 0x00000000 in ?? ()  
#13 0x00000000 in ?? ()  
#14 0x08079518 in ?? ()  
#15 0xbfffe318 in ?? ()  
#16 0xbfffe31c in ?? ()  
#17 0x40289100 in ?? ()  
#18 0x00000000 in ?? ()  
#19 0x00000004 in ?? ()  
#20 0x00000000 in ?? ()  
#21 0x402890b0 in ?? ()  
#22 0x40289060 in ?? ()  
---Type \<return\> to continue, or q \<return\> to quit---  
#23 0x402890b0 in ?? ()  
#24 0x400da214 in \_\_JCR\_LIST\_\_ () from /usr/lib/libruby.so.1.8  
#25 0x402989e8 in ?? ()  
#26 0x4005b690 in rb\_require () from /usr/lib/libruby.so.1.8  
Previous frame inner to this frame (corrupt stack?)  
(gdb)

If this still isn't what you need, let me know.

regards,  
jochen

> **···**
>
> Am Dienstag 13 Juli 2004 21:04 schrieb Alexander Kellett:
> 
> > start gdb with:  
> > &nbsp;&nbsp;&nbsp;gdb ruby  
> > then try  
> > &nbsp;&nbsp;&nbsp;run -e "require 'Qt'"  
> > can't test... don't have a working x11 installation :s  
> > but it should work if i remember gdb correctly 😛  
> > Alex
> > 
> > On Wed, Jul 14, 2004 at 03:41:56AM +0900, Jochen Immend?rfer wrote:  
> > \> hm.. I'm sorry to say so, but I don't now how to do this. If you tell me  
> > \> what I exactly have to do, I'll give my best 😉  
> > \>  
> > \> \> can you run in gdb?  
> > \> \> backtrace is reallllly needed  
> > \> \>  
> > \> \> Alex

---

<div class="post-metadata">

**Author:** ![Richard\_Dale](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Richard\_Dale](https://rubytalk.org/u/Richard_Dale)\
**Post date:** [13 July 2004 23:12 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/15 "2004-07-13T23:12:21Z")

</div>

Jochen Immendörfer wrote:

> Ok, I must confess I have not much experience in using gdb, but here is  
> what I get:
> 
> $ gdb ruby
> 
> (gdb) run -e "require 'Qt'"  
> Starting program: /usr/bin/ruby -e "require 'Qt'"  
> (no debugging symbols found)...(no debugging symbols found)...(no

This is a known problem - there is some sort of incompatibility between Qt  
and ruby on startup. The fix is to start your program via 'krubyinit'  
(found in korundum/bin).

-- Richard

---

<div class="post-metadata">

**Author:** ![Jochen\_Immendorfer](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Jochen\_Immendorfer](https://rubytalk.org/u/Jochen_Immendorfer)\
**Post date:** [14 July 2004 05:24 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/16 "2004-07-14T05:24:33Z")

</div>

> This is a known problem - there is some sort of incompatibility between Qt  
> and ruby on startup. The fix is to start your program via 'krubyinit'  
> (found in korundum/bin).
> 
> -- Richard

Hi, thanks for the information.  
I found krubyinit.cpp here:  
[http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/kdebindings/korundum/bin/krubyinit.cpp?rev=1.3&content-type=text/plain](http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/kdebindings/korundum/bin/krubyinit.cpp?rev=1.3&content-type=text/plain)

I tried to compile it with:

$ gcc -I/usr/lib/ruby/1.8/i686-linux -o krubyinit krubyinit.cpp -lruby

and received the error:

/tmp/cc5G9T5J.o(.eh\_frame+0x11): undefined reference to `\_\_gxx\_personality\_v0'

Is there anything else needed to link it with?

regards,  
jochen

---

<div class="post-metadata">

**Author:** ![Alexander\_Kellett2](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Alexander\_Kellett2](https://rubytalk.org/u/Alexander_Kellett2)\
**Post date:** [14 July 2004 07:49 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/17 "2004-07-14T07:49:28Z")

</div>

if i'm not busy this weekend i'll try and do  
qrubyinit and release a new qtruby tarball.

n.b. i'll inevitably be quite busy ☹

Alex

> **···**
>
> On Wed, Jul 14, 2004 at 02:24:33PM +0900, Jochen Immend?rfer wrote:
> 
> > \> This is a known problem - there is some sort of incompatibility between Qt  
> > \> and ruby on startup. The fix is to start your program via 'krubyinit'  
> > \> (found in korundum/bin).  
> > \>  
> > \> -- Richard
> > 
> > Hi, thanks for the information.  
> > I found krubyinit.cpp here:  
> > [http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/kdebindings/korundum/bin/krubyinit.cpp?rev=1.3&content-type=text/plain](http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/kdebindings/korundum/bin/krubyinit.cpp?rev=1.3&content-type=text/plain)
> > 
> > I tried to compile it with:
> > 
> > $ gcc -I/usr/lib/ruby/1.8/i686-linux -o krubyinit krubyinit.cpp -lruby
> > 
> > and received the error:
> > 
> > /tmp/cc5G9T5J.o(.eh\_frame+0x11): undefined reference to `\_\_gxx\_personality\_v0'
> > 
> > Is there anything else needed to link it with?
> > 
> > regards,  
> > jochen
> 
> mvg,  
> Alex
> 
> --  
> When women love us, they forgive us everything, even our crimes; when they do  
> not love us, they give us credit for nothing, not even our virtues.  
> &nbsp;&nbsp;&nbsp;&nbsp;-- Honor'e de Balzac

---

<div class="post-metadata">

**Author:** ![Richard\_Dale](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Richard\_Dale](https://rubytalk.org/u/Richard_Dale)\
**Post date:** [14 July 2004 07:57 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/18 "2004-07-14T07:57:21Z")

</div>

Jochen Immendörfer wrote:

> > This is a known problem - there is some sort of incompatibility between  
> > Qt and ruby on startup. The fix is to start your program via 'krubyinit'  
> > (found in korundum/bin).
> > 
> > -- Richard
> 
> Hi, thanks for the information.  
> I found krubyinit.cpp here:

[http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/kdebindings/korundum/bin/krubyinit.cpp?rev=1.3&content-type=text/plain](http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/kdebindings/korundum/bin/krubyinit.cpp?rev=1.3&content-type=text/plain)

> I tried to compile it with:
> 
> $ gcc -I/usr/lib/ruby/1.8/i686-linux -o krubyinit krubyinit.cpp -lruby
> 
> and received the error:
> 
> /tmp/cc5G9T5J.o(.eh\_frame+0x11): undefined reference to  
> `\_\_gxx\_personality\_v0'
> 
> Is there anything else needed to link it with?

I haven't heard of that one before. The build problem I had with krubyinit  
was that it was expecting to link against libruby.so, and ruby didn't build  
that be default. I needed to use '--enable-shared' configure option and  
build ruby. I searched google for your error, and it looks like you need to  
link with g++ rather than gcc.

-- Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Dale](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Richard\_Dale](https://rubytalk.org/u/Richard_Dale)\
**Post date:** [14 July 2004 10:52 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/19 "2004-07-14T10:52:20Z")

</div>

Alexander Kellett wrote:

> if i'm not busy this weekend i'll try and do  
> qrubyinit and release a new qtruby tarball.
> 
> n.b. i'll inevitably be quite busy ☹
> 
> Alex

Do you really mean 'qrubyinit' or was it a typo for 'qtrubyinit'? I've fixed  
the '(void \*)' cast problem in the kde cvs now.

-- Richard

---

<div class="post-metadata">

**Author:** ![Alexander\_Kellett2](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Alexander\_Kellett2](https://rubytalk.org/u/Alexander_Kellett2)\
**Post date:** [14 July 2004 11:04 UTC](https://rubytalk.org/t/qtruby-compilation-error/12550/20 "2004-07-14T11:04:23Z")

</div>

qtrubyinit sounds better in fact.  
i wasn't really sure 🙂

Alex

> **···**
>
> On Wed, Jul 14, 2004 at 07:52:20PM +0900, Richard Dale wrote:
> 
> > Do you really mean 'qrubyinit' or was it a typo for 'qtrubyinit'? I've fixed  
> > the '(void \*)' cast problem in the kde cvs now.
> > 
> > -- Richard
