# Compiling qtruby

**URL:** <https://rubytalk.org/t/compiling-qtruby/15934>\
**Category:** ruby-talk\
**Created:** [21 January 2005 16:20 UTC](https://rubytalk.org/t/compiling-qtruby/15934 "2005-01-21T16:20:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DP1](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@DP1](https://rubytalk.org/u/DP1)\
**Post date:** [21 January 2005 16:20 UTC](https://rubytalk.org/t/compiling-qtruby/15934/1 "2005-01-21T16:20:58Z")

</div>

Hi -  
I'm trying to compile qtruby and I'm having some issues.  
I have tried both compiling from the kdebindings package AND from  
the qtruby standalone package and the same error occurs:

The compile process always seems to die on an undefined reference to  
some ruby functions. I'm using Fedora Core 2.

This is the last output from make:

/bin/sh ../../libtool --silent --mode=link --tag=CXX g++  
-Wnon-virtual-dtor -Wno-long-lo ng -Wundef -ansi -D\_XOPEN\_SOURCE=500  
-D\_BSD\_SOURCE -Wcast-align -Wconversion -Wchar-subsc ripts -Wall -W  
-Wpointer-arith -Wwrite-strings -O2 -Wformat-security  
-Wmissing-format-att ribute -fno-exceptions -fno-check-new -fno-common  
-o qtrubyinit -module -L/usr/lib -L/ usr/lib/qt-3.3/lib  
-L/usr/X11R6/lib -version-info 0:0:0 -L../../smoke/qt/ -L/usr/local  
/lib qtrubyinit.o -lqt-mt -lz -lpng -lz -lm -lXext -lX11 -lSM -lICE  
-lpthread -Wl,-R -W l,/usr/local/lib -L/usr/local/lib -L.  
.../../smoke/qt/libsmokeqt.la  
.../../qtruby/rubylib/ qtruby/libqtrubyinternal.la  
libtool: link: warning: `-version-info' is ignored for programs  
qtrubyinit.o(.text+0xa): In function `main':  
: undefined reference to `ruby\_init'  
qtrubyinit.o(.text+0x18): In function `main':  
: undefined reference to `ruby\_script'  
qtrubyinit.o(.text+0x25): In function `main':  
: undefined reference to `ruby\_options'  
qtrubyinit.o(.text+0x2a): In function `main':  
: undefined reference to `ruby\_run'  
collect2: ld returned 1 exit status  
make[3]: \*\*\* [qtrubyinit] Error 1  
make[3]: Leaving directory  
`/home/davp/downloads/kdebindings-050120/qtruby/bin'  
make[2]: \*\*\* [all-recursive] Error 1  
make[2]: Leaving directory  
`/home/davp/downloads/kdebindings-050120/qtruby'  
make[1]: \*\*\* [all-recursive] Error 1  
make[1]: Leaving directory `/home/davp/downloads/kdebindings-050120'  
make: \*\*\* [all] Error 2

Any suggestions?

Thank you,  
David

---

<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:** [21 January 2005 18:35 UTC](https://rubytalk.org/t/compiling-qtruby/15934/2 "2005-01-21T18:35:48Z")

</div>

quick solution:  
&nbsp;&nbsp;make -k  
&nbsp;&nbsp;make -k install  
more useful solution:  
could you give me the result of:  
&nbsp;&nbsp;ruby -r rbconfig -e 'c=Config::CONFIG;mc=c.keys.map{|str|str.length}.max;puts c.keys.sort.map {|dom| "#{dom.rjust mc+1} =\> #{c[dom]}"}.join "\n"'

> **···**
>
> On Jan 21, 2005, at 5:20 PM, DP wrote:
> 
> > Hi -  
> > I'm trying to compile qtruby and I'm having some issues.  
> > I have tried both compiling from the kdebindings package AND from  
> > the qtruby standalone package and the same error occurs:
> > 
> > The compile process always seems to die on an undefined reference to  
> > some ruby functions. I'm using Fedora Core 2.
> > 
> > This is the last output from make:
> > 
> > /bin/sh ../../libtool --silent --mode=link --tag=CXX g++  
> > -Wnon-virtual-dtor -Wno-long-lo ng -Wundef -ansi -D\_XOPEN\_SOURCE=500  
> > -D\_BSD\_SOURCE -Wcast-align -Wconversion -Wchar-subsc ripts -Wall -W  
> > -Wpointer-arith -Wwrite-strings -O2 -Wformat-security  
> > -Wmissing-format-att ribute -fno-exceptions -fno-check-new -fno-common  
> > -o qtrubyinit -module -L/usr/lib -L/ usr/lib/qt-3.3/lib  
> > -L/usr/X11R6/lib -version-info 0:0:0 -L../../smoke/qt/ -L/usr/local  
> > /lib qtrubyinit.o -lqt-mt -lz -lpng -lz -lm -lXext -lX11 -lSM -lICE  
> > -lpthread -Wl,-R -W l,/usr/local/lib -L/usr/local/lib -L.  
> > .../../smoke/qt/libsmokeqt.la  
> > .../../qtruby/rubylib/ qtruby/libqtrubyinternal.la  
> > libtool: link: warning: `-version-info' is ignored for programs  
> > qtrubyinit.o(.text+0xa): In function `main':  
> > : undefined reference to `ruby\_init'  
> > qtrubyinit.o(.text+0x18): In function `main':  
> > : undefined reference to `ruby\_script'  
> > qtrubyinit.o(.text+0x25): In function `main':  
> > : undefined reference to `ruby\_options'  
> > qtrubyinit.o(.text+0x2a): In function `main':  
> > : undefined reference to `ruby\_run'  
> > collect2: ld returned 1 exit status  
> > make[3]: \*\*\* [qtrubyinit] Error 1  
> > make[3]: Leaving directory  
> > `/home/davp/downloads/kdebindings-050120/qtruby/bin'  
> > make[2]: \*\*\* [all-recursive] Error 1  
> > make[2]: Leaving directory  
> > `/home/davp/downloads/kdebindings-050120/qtruby'  
> > make[1]: \*\*\* [all-recursive] Error 1  
> > make[1]: Leaving directory `/home/davp/downloads/kdebindings-050120'  
> > make: \*\*\* [all] Error 2
> > 
> > Any suggestions?
> > 
> > Thank you,  
> > David

---

<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:** [22 January 2005 08:35 UTC](https://rubytalk.org/t/compiling-qtruby/15934/3 "2005-01-22T08:35:59Z")

</div>

DP wrote:

> Hi -  
> I'm trying to compile qtruby and I'm having some issues.  
> I have tried both compiling from the kdebindings package AND from  
> the qtruby standalone package and the same error occurs:
> 
> The compile process always seems to die on an undefined reference to  
> some ruby functions. I'm using Fedora Core 2.
> 
> This is the last output from make:
> 
> /bin/sh ../../libtool --silent --mode=link --tag=CXX g++  
> -Wnon-virtual-dtor -Wno-long-lo ng -Wundef -ansi -D\_XOPEN\_SOURCE=500  
> -D\_BSD\_SOURCE -Wcast-align -Wconversion -Wchar-subsc ripts -Wall -W  
> -Wpointer-arith -Wwrite-strings -O2 -Wformat-security  
> -Wmissing-format-att ribute -fno-exceptions -fno-check-new -fno-common  
> -o qtrubyinit -module -L/usr/lib -L/ usr/lib/qt-3.3/lib  
> -L/usr/X11R6/lib -version-info 0:0:0 -L../../smoke/qt/ -L/usr/local  
> /lib qtrubyinit.o -lqt-mt -lz -lpng -lz -lm -lXext -lX11 -lSM -lICE  
> -lpthread -Wl,-R -W l,/usr/local/lib -L/usr/local/lib -L.  
> ../../smoke/qt/libsmokeqt.la  
> ../../qtruby/rubylib/ qtruby/libqtrubyinternal.la  
> libtool: link: warning: `-version-info' is ignored for programs  
> qtrubyinit.o(.text+0xa): In function `main':  
> : undefined reference to `ruby\_init'  
> qtrubyinit.o(.text+0x18): In function `main':  
> : undefined reference to `ruby\_script'  
> qtrubyinit.o(.text+0x25): In function `main':  
> : undefined reference to `ruby\_options'  
> qtrubyinit.o(.text+0x2a): In function `main':  
> : undefined reference to `ruby\_run'  
> collect2: ld returned 1 exit status  
> make[3]: \*\*\* [qtrubyinit] Error 1  
> make[3]: Leaving directory  
> `/home/davp/downloads/kdebindings-050120/qtruby/bin'  
> make[2]: \*\*\* [all-recursive] Error 1  
> make[2]: Leaving directory  
> `/home/davp/downloads/kdebindings-050120/qtruby'  
> make[1]: \*\*\* [all-recursive] Error 1  
> make[1]: Leaving directory `/home/davp/downloads/kdebindings-050120'  
> make: \*\*\* [all] Error 2

The shared library 'libruby.so' is missing, so you need to build ruby with  
the '--enable-shared' option. But you shouldn't usually need to use the  
'qtrubyinit' command line tool anyway.

-- Richard

---

<div class="post-metadata">

**Author:** ![DP1](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@DP1](https://rubytalk.org/u/DP1)\
**Post date:** [21 January 2005 19:50 UTC](https://rubytalk.org/t/compiling-qtruby/15934/4 "2005-01-21T19:50:57Z")

</div>

Alexander -  
Thank you for the info. Make -k continued compiling but I still could  
not get qtruby to work.

Thank you!  
David

[davp@parfitt kdebindings-050120]$ ruby -r rbconfig -e  
'c=Config::CONFIG;mc=c.keys.map{|str|str.length}.max;puts  
c.keys.sort.map {|dom| "#{dom.rjust mc+1} =\> #{c[dom]}"}.join "\n"'  
-e:1: warning: parenthesize argument(s) for future version  
ALLOCA =\>  
AR =\> ar  
ARCHFILE =\>  
ARCH\_FLAG =\>  
CC =\> gcc  
CCDLFLAGS =\> -fPIC  
CFLAGS =\> -g -O2 -fPIC  
COMMON\_HEADERS =\>  
COMMON\_LIBS =\>  
COMMON\_MACROS =\>  
CPP =\> gcc -E  
CPPFLAGS =\>  
CPPOUTFILE =\> -o conftest.i  
DESTDIR =\>  
DLDFLAGS =\>  
DLDLIBS =\> -lc  
DLEXT =\> so  
DLEXT2 =\>  
DLLWRAP =\>  
ECHO\_C =\>  
ECHO\_N =\> -n  
ECHO\_T =\>  
EGREP =\> grep -E  
ENABLE\_SHARED =\> yes  
EXEEXT =\>  
EXPORT\_PREFIX =\>  
EXTSTATIC =\>  
GNU\_LD =\> yes  
LDFLAGS =\> -rdynamic -Wl,-export-dynamic  
LDSHARED =\> gcc -shared  
LIBEXT =\> a  
LIBOBJS =\>  
LIBPATHFLAG =\> -L'%1$-s'  
LIBRUBY =\> libruby.so.1.8.2  
LIBRUBYARG =\> -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -L.  
-lruby  
LIBRUBYARG\_SHARED =\> -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -L.  
-lruby  
LIBRUBYARG\_STATIC =\> -lruby-static  
LIBRUBY\_A =\> libruby-static.a  
LIBRUBY\_ALIASES =\> libruby.so.1.8 [libruby.so](http://libruby.so)  
LIBRUBY\_DLDFLAGS =\> -Wl,-soname,libruby.so.1.8  
LIBRUBY\_LDSHARED =\> gcc -shared  
LIBRUBY\_SO =\> libruby.so.1.8.2  
LIBS =\> -ldl -lcrypt -lm  
LINK\_SO =\>  
LN\_S =\> ln -s  
LTLIBOBJS =\>  
MAINLIBS =\>  
MAJOR =\> 1  
MAKEFILES =\> Makefile  
MANTYPE =\> doc  
MINIRUBY =\> ./miniruby  
MINOR =\> 8  
NM =\>  
NROFF =\> /usr/bin/nroff  
OBJEXT =\> o  
OUTFLAG =\> -o  
PACKAGE\_BUGREPORT =\>  
PACKAGE\_NAME =\>  
PACKAGE\_STRING =\>  
PACKAGE\_TARNAME =\>  
PACKAGE\_VERSION =\>  
PATH\_SEPARATOR =\> :  
PREP =\>  
RANLIB =\> ranlib  
RDOCTARGET =\> install-doc  
RPATHFLAG =\> -Wl,-R'%1$-s'  
RUBYW\_INSTALL\_NAME =\>  
RUBY\_INSTALL\_NAME =\> ruby  
RUBY\_SO\_NAME =\> ruby  
SET\_MAKE =\>  
SHELL =\> /bin/sh  
SOLIBS =\> -ldl -lcrypt -lm  
STATIC =\>  
STRIP =\> strip -S -x  
TEENY =\> 2  
TRY\_LINK =\>  
WINDRES =\>  
XCFLAGS =\>  
XLDFLAGS =\> -L.  
YACC =\> bison -y  
abs\_builddir =\> $(ac\_abs\_builddir)  
abs\_srcdir =\> $(ac\_abs\_srcdir)  
abs\_top\_builddir =\> $(ac\_abs\_top\_builddir)  
abs\_top\_srcdir =\> $(ac\_abs\_top\_srcdir)  
ac\_ct\_AR =\> ar  
ac\_ct\_CC =\> gcc  
ac\_ct\_DLLWRAP =\>  
ac\_ct\_NM =\>  
ac\_ct\_RANLIB =\> ranlib  
ac\_ct\_WINDRES =\>  
arch =\> i686-linux  
archdir =\> /usr/local/lib/ruby/1.8/i686-linux  
bindir =\> /usr/local/bin  
build =\> i686-pc-linux-gnu  
build\_alias =\>  
build\_cpu =\> i686  
build\_os =\> linux-gnu  
build\_vendor =\> pc  
builddir =\> $(ac\_builddir)  
compile\_dir =\> /home/davp/downloads/ruby-1.8.2  
configure\_args =\> '--enable-shared' '--enable-install-doc'  
datadir =\> /usr/local/share  
exec\_prefix =\> /usr/local  
host =\> i686-pc-linux-gnu  
host\_alias =\>  
host\_cpu =\> i686  
host\_os =\> linux-gnu  
host\_vendor =\> pc  
includedir =\> /usr/local/include  
infodir =\> /usr/local/info  
libdir =\> /usr/local/lib  
libexecdir =\> /usr/local/libexec  
localstatedir =\> /usr/local/var  
mandir =\> /usr/local/man  
oldincludedir =\> /usr/include  
prefix =\> /usr/local  
ruby\_install\_name =\> ruby  
ruby\_version =\> 1.8  
rubylibdir =\> /usr/local/lib/ruby/1.8  
rubyw\_install\_name =\>  
sbindir =\> /usr/local/sbin  
setup =\> Setup  
sharedstatedir =\> /usr/local/com  
sitearch =\> i686-linux  
sitearchdir =\> /usr/local/lib/ruby/site\_ruby/1.8/i686-linux  
sitedir =\> /usr/local/lib/ruby/site\_ruby  
sitelibdir =\> /usr/local/lib/ruby/site\_ruby/1.8  
srcdir =\> /home/davp/downloads/ruby-1.8.2  
sysconfdir =\> /usr/local/etc  
target =\> i686-pc-linux-gnu  
target\_alias =\>  
target\_cpu =\> i686  
target\_os =\> linux  
target\_vendor =\> pc  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top\_builddir =\> $(ac\_top\_builddir)

---

<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:** [22 January 2005 11:50 UTC](https://rubytalk.org/t/compiling-qtruby/15934/5 "2005-01-22T11:50:04Z")

</div>

see the following in the other reply:  
&nbsp;&nbsp;LIBRUBY =\> libruby.so.1.8.2  
detection seems to be wrong  
i \*think\* there are two possible  
options that can have the so name  
and we should probably || the  
second one just in case the first  
isn't set. did this in the past  
but reverted as noone else had  
the problem. could you revert  
the revert richard? (hope i  
commited really can't recall)

thanks 🙂  
Alex

> **···**
>
> On Jan 22, 2005, at 9:35 AM, Richard Dale wrote:
> 
> > The shared library 'libruby.so' is missing, so you need to build ruby with  
> > the '--enable-shared' option. But you shouldn't usually need to use the  
> > 'qtrubyinit' command line tool anyway.

---

<div class="post-metadata">

**Author:** ![DP1](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@DP1](https://rubytalk.org/u/DP1)\
**Post date:** [24 January 2005 18:55 UTC](https://rubytalk.org/t/compiling-qtruby/15934/6 "2005-01-24T18:55:50Z")

</div>

Hi -  
Even by recompiling Ruby 1.8.2 with --enable-shared, I still have the  
same problem.

Thanks -  
David
