From: Paul Duncan Date: 2004-10-23T01:04:45+09:00 Subject: Re: Problem writting bindings --UljtkXebtcviItgt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Erwan Loisant (eloisant@gmail.com) wrote: > Hello. >=20 > I am writing Ruby bindings for a C library that I wrote myself. I have > a problem when running extconf. >=20 > My library uses glib so I added glib also. >=20 > ---- > erwan@bourricot Galois $ cat extconf.rb > require 'mkmf' >=20 > dir_config('libGalois') > dir_config('glib') >=20 > have_library('glib') > have_library('libGalois') >=20 > create_makefile('GaloisNode') > ---- >=20 > Then I launch extconf.rb: >=20 > ---- > erwan@bourricot Galois $ ruby extconf.rb > --with-libGalois-dir=3D/usr/local/ > checking for main() in -lglib... yes > checking for main() in -llibGalois... no > creating Makefile > ---- >=20 > The problem is in the generated Makefile, "-lglib" is added but not > "-llibGalois". I guess the "checking for main() in -llibGalois... no" > is the error message related to the problem but I can't figure what it > means. A library is not supposed to have main() loop, right? You should pass a function in the library to the have_library method, like this: have_library('glib', 'g_timer_start') My guess is you'll want the other have_library call to look like this: have_library('Galois', 'func_name') # note the omitted 'lib' prefix Hope that helps... --=20 Paul Duncan pabs in #ruby-lang (OPN IRC) http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562 --UljtkXebtcviItgt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBeS/AzdlT34LClWIRAjwyAJwJpx8ZqvNkosDJovFYhvgaWqp8ZACgyWSr z5rKifMNINzF5vfWjwj6LYw= =PlBv -----END PGP SIGNATURE----- --UljtkXebtcviItgt--