# Installing from source missing -lruby18 in linking

**URL:** <https://www.ruby-forum.com/t/installing-from-source-missing-lruby18-in-linking/216693>\
**Category:** wxRuby\
**Created:** [February 10, 2012, 8:52pm UTC](https://www.ruby-forum.com/t/installing-from-source-missing-lruby18-in-linking/216693 "2012-02-10T20:52:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 10, 2012, 8:52pm UTC](https://www.ruby-forum.com/t/installing-from-source-missing-lruby18-in-linking/216693/1 "2012-02-10T20:52:24Z")

</div>

I am trying to build wxruby from source, but I have encounter an error.

For some reason the ‘rake’ command fail when it tries to link  
lib/wxruby2.so  
because it is missing missing -lruby18

resulting in errors like

wx.cpp:(.text+0x1618): undefined reference to `rb_intern' wx.cpp:(.text+0x165c): undefined reference to`rb\_eNotImpError’  
wx.cpp:(.text+0x1666): undefined reference to `rb_raise' wx.cpp:(.text+0x167d): undefined reference to`rb\_const\_defined’  
wx.cpp:(.text+0x1698): undefined reference to `rb\_const\_get’

could it be a bad expansion of values in the Config::CONFIG hash ?

And if it is, how do I verify that it is the problem?

How does the Config hash get filled with values?

How do I check that Config::CONFIG[“LDFLAGS”] and  
Config::CONFIG[“LIBS”] contains the right values?

Here is a grep of the config hash –  
shs@cybert /store/download/wxruby-2.0.1 $ grep -r ‘CONFIG[’ \*  
rake/rakemswin.rb:lib\_ruby = File.join(Config::CONFIG[‘libdir’],  
Config::CONFIG[‘LIBRUBY’])  
rake/rakemswin.rb: mv ‘msvcp80.dll’, Config::CONFIG[‘bindir’]  
rake/rakemswin.rb: mv ‘msvcr80.dll’, Config::CONFIG[‘bindir’]  
rake/rakemswin.rb: ruby\_manifest = File.join(Config::CONFIG[‘bindir’],  
‘ruby.exe.manifest’)  
rake/rakemswin.rb: rubyw\_manifest = File.join(Config::CONFIG[‘bindir’],  
‘rubyw.exe.manifest’)  
rake/rakemingw.rb: File.join(Config::CONFIG[‘libdir’],  
Config::CONFIG[‘LIBRUBY’])  
rake/rakeconfigure.rb:$ruby\_cppflags = Config::CONFIG[“CFLAGS”]  
rake/rakeconfigure.rb: includes = [Config::CONFIG[“rubyhdrdir”],  
rake/rakeconfigure.rb: Config::CONFIG[“sitehdrdir”],  
rake/rakeconfigure.rb: Config::CONFIG[“vendorhdrdir”],  
rake/rakeconfigure.rb:  
File.join(Config::CONFIG[“rubyhdrdir”],  
rake/rakeconfigure.rb: Config::CONFIG[‘arch’]) ]  
rake/rakeconfigure.rb: $ruby\_includes = " -I. -I " +  
Config::CONFIG[“archdir”]  
rake/rakeconfigure.rb:$ruby\_ldflags = Config::CONFIG[“LDFLAGS”]  
rake/rakeconfigure.rb:$ruby\_libs = Config::CONFIG[“LIBS”]  
rake/rakeconfigure.rb:OBJ\_EXT = Config::CONFIG[“OBJEXT”]  
rake/rakewx.rb:$ruby\_exe = Config::CONFIG[“ruby\_install\_name”]  
rake/rakewx.rb: dest\_dir = Config::CONFIG[‘sitelibdir’]  
rake/rakewx.rb: cp TARGET\_LIB, Config::CONFIG[‘sitearchdir’]  
rake/rakewx.rb: rm\_rf  
File.join(Config::CONFIG[‘sitearchdir’],File.basename(TARGET\_LIB))  
rake/rakewx.rb: rm\_rf File.join(Config::CONFIG[‘sitelibdir’], ‘wx.rb’)  
rake/rakewx.rb: rm\_rf File.join(Config::CONFIG[‘sitelibdir’], ‘wx’)  
rakefile:DLL\_LIB = “wxruby2.#{Config::CONFIG[“DLEXT”]}”

PS. I am working on a linux system.  
uname -a  
Linux cybert 2.6.31-gentoo-r6 #1 SMP Wed Aug 24 17:09:01 CEST 2011 i686  
Intel® Core™2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux

---

<div class="post-metadata">

**Author:** ![SSSvend\_Haugaard\_SS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9e5f3/32.png) [@SSSvend\_Haugaard\_SS](https://www.ruby-forum.com/u/SSSvend_Haugaard_SS)\
**Post date:** [February 10, 2012, 10:51pm UTC](https://www.ruby-forum.com/t/installing-from-source-missing-lruby18-in-linking/216693/2 "2012-02-10T22:51:35Z")

</div>

Hello Svend,

I’m not sure about the reasons for the error, but that CONFIG hash is  
built  
in to ruby. You can query it in IRB by typing “require rbconfig” then  
access it with Config::CONFIG.

2012/2/11 Svend Haugaard S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![SSSvend\_Haugaard\_SS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9e5f3/32.png) [@SSSvend\_Haugaard\_SS](https://www.ruby-forum.com/u/SSSvend_Haugaard_SS)\
**Post date:** [February 11, 2012, 10:12am UTC](https://www.ruby-forum.com/t/installing-from-source-missing-lruby18-in-linking/216693/3 "2012-02-11T10:12:02Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Am 10.02.2012 20:48, schrieb Svend Haugaard Sørensen:

> wx.cpp:(.text+0x1666): undefined reference to `rb_raise' wx.cpp:(.text+0x167d): undefined reference to `rb\_const\_defined’  
> wx.cpp:(.text+0x1698): undefined reference to `rb\_const\_get’

You need to build your Ruby interpreter with --enable-shared,  
otherwise the Ruby shared library won’t be built. You can easily test  
whether your Ruby interpreter was built with that option:

require “rbconfig”  
p Config::CONFIG[“configure\_args”]

This has to contain “–enable-shared” somewhere, otherwise you don’t  
have the Ruby shared library wxRuby wants to link against (you can  
also simply check whether you have “libruby18.so” in your Ruby  
installation’s lib/ subdirectory). If the option isn’t present, you  
have to recompile your Ruby interpreter accordingly.

Vale,  
Marvin  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.11 (GNU/Linux)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org/](http://enigmail.mozdev.org/)

iQEcBAEBAgAGBQJPNivKAAoJELh1XLHFkqhap4oH/RGgpyqZY0B3ft7hITXixYaY  
r5xELHJZM6vsLVK2eehkxzczQepamSLli63HP5DDzL2aXwHqRA5q2gAPh0pd03Aa  
uHykDDwwwr8t2iMJq/MSUJ4GnNHwVbVnvm+wG6t2nltbwPAiz+Ls1zoBYG7l5t0j  
b/9RToiD68nnqUB6GPuM7Oe1F3AvGi8sbi/GI0ws7q2YXdJPwLRQdxRze6Qpqomr  
ccp68ahlwXriZEdlIt8nSOJoFZCdEMyM0u83seqvkSYJCPlKl82jy2JiWtshwaKk  
E4N5H9BeLMXvqvS5dmfWXRigdbIGfNXJY9vImvd7Po3yWngMYEOC7xZ+YOQkfKs=  
=LjKG  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![SSSvend\_Haugaard\_SS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9e5f3/32.png) [@SSSvend\_Haugaard\_SS](https://www.ruby-forum.com/u/SSSvend_Haugaard_SS)\
**Post date:** [February 11, 2012, 6:16pm UTC](https://www.ruby-forum.com/t/installing-from-source-missing-lruby18-in-linking/216693/4 "2012-02-11T18:16:00Z")

</div>

On Sat, 11 Feb 2012 08:32:04 +1100  
David B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello Svend,
> 
> I’m not sure about the reasons for the error, but that CONFIG hash is  
> built in to ruby. You can query it in IRB by typing “require  
> rbconfig” then access it with Config::CONFIG.

Here is a printout of the config hash. As you can see “LDFLAGS” and  
“LIBS” don’t contain -lruby18 (I assume that where the rakeconfig  
script should get it from).

Please try this on you machine and show me your listing, so we can  
compare.

irb(main):006:0\> (Config::CONFIG.sort).each {|p| puts p.inspect}  
[“ALLOCA”, “”]  
[“AR”, “i686-pc-linux-gnu-ar”]  
[“ARCHFILE”, “”]  
[“ARCH\_FLAG”, “”]  
[“AS”, “i686-pc-linux-gnu-as”]  
[“ASFLAGS”, “”]  
[“CC”, “i686-pc-linux-gnu-gcc”]  
[“CCDLFLAGS”, " -fPIC"]  
[“CFLAGS”, "-O2 -march=prescott -pipe -fno-strict-aliasing -fPIC “]  
[“COMMON\_HEADERS”, “”]  
[“COMMON\_LIBS”, “”]  
[“COMMON\_MACROS”, “”]  
[“CP”, “cp”]  
[“CPP”, “i686-pc-linux-gnu-gcc -E”]  
[“CPPFLAGS”, " -D\_FILE\_OFFSET\_BITS=64 “]  
[“CPPOUTFILE”, “-o conftest.i”]  
[“DEFS”, “-D\_FILE\_OFFSET\_BITS=64”]  
[“DESTDIR”, “”]  
[“DLDFLAGS”, “”]  
[“DLDLIBS”, " -lc”]  
[“DLEXT”, “so”]  
[“DLEXT2”, “”]  
[“DLLWRAP”, “”]  
[“ECHO\_C”, “”]  
[“ECHO\_N”, “-n”]  
[“ECHO\_T”, “”]  
[“EGREP”, “/bin/grep -E”]  
[“ENABLE\_SHARED”, “yes”]  
[“EXEEXT”, “”]  
[“EXPORT\_PREFIX”, “”]  
[“EXTOUT”, “.ext”]  
[“EXTSTATIC”, “”]  
[“GNU\_LD”, “yes”]  
[“GREP”, “/bin/grep”]  
[“INSTALL”, “/usr/bin/install -c”]  
[“INSTALL\_DATA”, “/usr/bin/install -c -m 644”]  
[“INSTALL\_PROGRAM”, “/usr/bin/install -c”]  
[“INSTALL\_SCRIPT”, “/usr/bin/install -c”]  
[“LDFLAGS”, “-L. -Wl,-O1 -Wl,–as-needed -rdynamic -Wl,-export-dynamic  
-Wl,–no-undefined”]  
[“LDSHARED”, “i686-pc-linux-gnu-gcc -shared”]  
[“LIBEXT”, “a”]  
[“LIBPATHENV”, “LD\_LIBRARY\_PATH”]  
[“LIBPATHFLAG”, " -L%1$-s”]  
[“LIBRUBY”, “libruby18.so.1.8.7”]  
[“LIBRUBYARG”, “-Wl,-R -Wl,/usr/lib -L/usr/lib -lruby18”]  
[“LIBRUBYARG\_SHARED”, “-Wl,-R -Wl,/usr/lib -L/usr/lib -lruby18”]  
[“LIBRUBYARG\_STATIC”, “-lruby18-static”]  
[“LIBRUBY\_A”, “libruby18-static.a”]  
[“LIBRUBY\_ALIASES”, “libruby18.so.1.8 libruby18.so”]  
[“LIBRUBY\_DLDFLAGS”, “-Wl,-soname,libruby18.so.1.8”]  
[“LIBRUBY\_LDSHARED”, “i686-pc-linux-gnu-gcc -shared”]  
[“LIBRUBY\_SO”, “libruby18.so.1.8.7”]  
[“LIBS”, "-lrt -ldl -lcrypt -lm "]  
[“LINK\_SO”, “”]  
[“LN\_S”, “ln -s”]  
[“MAINLIBS”, “”]  
[“MAJOR”, “1”]  
[“MAKEDIRS”, “mkdir -p”]  
[“MAKEFILES”, “Makefile”]  
[“MANTYPE”, “doc”]  
[“MINOR”, “8”]  
[“NM”, “”]  
[“NROFF”, “/usr/bin/nroff”]  
[“OBJDUMP”, “”]  
[“OBJEXT”, “o”]  
[“OUTFLAG”, "-o “]  
[“PACKAGE\_BUGREPORT”, “”]  
[“PACKAGE\_NAME”, “”]  
[“PACKAGE\_STRING”, “”]  
[“PACKAGE\_TARNAME”, “”]  
[“PACKAGE\_URL”, “”]  
[“PACKAGE\_VERSION”, “”]  
[“PATCHLEVEL”, “352”]  
[“PATH\_SEPARATOR”, “:”]  
[“PREP”, “miniruby”]  
[“RANLIB”, “i686-pc-linux-gnu-ranlib”]  
[“RDOCTARGET”, “install-doc”]  
[“RM”, “rm -f”]  
[“RPATHFLAG”, " -Wl,-R%1$-s”]  
[“RUBYW\_INSTALL\_NAME”, “”]  
[“RUBY\_INSTALL\_NAME”, “ruby18”]  
[“RUBY\_SO\_NAME”, “ruby18”]  
[“SET\_MAKE”, “”]  
[“SHELL”, “/bin/sh”]  
[“SOLIBS”, "-lrt -ldl -lcrypt -lm "]  
[“STATIC”, “”]  
[“STRIP”, “strip -S -x”]  
[“TEENY”, “7”]  
[“TRY\_LINK”, “”]  
[“WINDRES”, “”]  
[“YACC”, “bison -y”]  
[“YFLAGS”, “”]  
[“arch”, “i686-linux”]  
[“archdir”, “/usr/lib/ruby/1.8/i686-linux”]  
[“bindir”, “/usr/bin”]  
[“build”, “i686-pc-linux-gnu”]  
[“build\_alias”, “i686-pc-linux-gnu”]  
[“build\_cpu”, “i686”]  
[“build\_os”, “linux-gnu”]  
[“build\_vendor”, “pc”]  
[“cflags”, " “]  
[“configure\_args”, " ‘–prefix=/usr’ ‘–build=i686-pc-linux-gnu’  
‘–host=i686-pc-linux-gnu’ ‘–mandir=/usr/share/man’  
‘–infodir=/usr/share/info’ ‘–datadir=/usr/share’ ‘–sysconfdir=/etc’  
‘–localstatedir=/var/lib’ ‘–program-suffix=18’ ‘–enable-shared’  
‘–disable-socks’ ‘–enable-install-doc’ ‘–disable-pthread’  
‘–enable-ipv6’ ‘–disable-debug’ ‘–with-dbm’ ‘–with-gdbm’  
‘–with-openssl’ ‘–without-tk’ ‘–with-curses’  
‘–with-lookup-order-hack=INET’ ‘–with-readline’  
‘–with-sitedir=/usr/lib/ruby/site\_ruby’ ‘–enable-option-checking=no’  
‘build\_alias=i686-pc-linux-gnu’ ‘host\_alias=i686-pc-linux-gnu’  
‘CFLAGS=-O2 -march=prescott -pipe -fno-strict-aliasing’ ‘LDFLAGS=-Wl,-O1  
-Wl,–as-needed’ ‘CPPFLAGS=’”]  
[“cppflags”, “”]  
[“datadir”, “/usr/share”]  
[“datarootdir”, “/usr/share”]  
[“debugflags”, “”]  
[“docdir”, “/usr/share/doc/$(PACKAGE)”]  
[“dvidir”, “/usr/share/doc/$(PACKAGE)”]  
[“exec\_prefix”, “/usr”]  
[“host”, “i686-pc-linux-gnu”]  
[“host\_alias”, “i686-pc-linux-gnu”]  
[“host\_cpu”, “i686”]  
[“host\_os”, “linux-gnu”]  
[“host\_vendor”, “pc”]  
[“htmldir”, “/usr/share/doc/$(PACKAGE)”]  
[“includedir”, “/usr/include”]  
[“infodir”, “/usr/share/info”]  
[“libdir”, “/usr/lib”]  
[“libexecdir”, “/usr/libexec”]  
[“localedir”, “/usr/share/locale”]  
[“localstatedir”, “/var/lib”]  
[“mandir”, “/usr/share/man”]  
[“oldincludedir”, “/usr/include”]  
[“optflags”, “”]  
[“pdfdir”, “/usr/share/doc/$(PACKAGE)”]  
[“prefix”, “/usr”]  
[“psdir”, “/usr/share/doc/$(PACKAGE)”]  
[“ruby\_install\_name”, “ruby18”]  
[“ruby\_version”, “1.8”]  
[“rubylibdir”, “/usr/lib/ruby/1.8”]  
[“rubyw\_install\_name”, “”]  
[“sbindir”, “/usr/sbin”]  
[“setup”, “Setup”]  
[“sharedstatedir”, “/usr/com”]  
[“sitearch”, “i686-linux”]  
[“sitearchdir”, “/usr/lib/ruby/site\_ruby/1.8/i686-linux”]  
[“sitedir”, “/usr/lib/ruby/site\_ruby”]  
[“sitelibdir”, “/usr/lib/ruby/site\_ruby/1.8”]  
[“sysconfdir”, “/etc”]  
[“target”, “i686-pc-linux-gnu”]  
[“target\_alias”, “”]  
[“target\_cpu”, “i686”]  
[“target\_os”, “linux”]  
[“target\_vendor”, “pc”]  
[“topdir”, “/usr/lib/ruby/1.8/i686-linux”]  
[“vendorarchdir”, “/usr/lib/ruby/vendor\_ruby/1.8/i686-linux”]  
[“vendordir”, “/usr/lib/ruby/vendor\_ruby”]  
[“vendorlibdir”, “/usr/lib/ruby/vendor\_ruby/1.8”]
