[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

mkmf isn't finding my shared object to link with

Tristin Davis

7/6/2008 4:56:00 PM

[Note: parts of this message were removed to make it a legal post.]

I have an extension I wrote which is actually just a wrapper for a C api.
The directory structure looks like this.
2 Answers

Stefano Crocco

7/6/2008 5:12:00 PM

0

On Sunday 06 July 2008, Tristin Davis wrote:
> I have an extension I wrote which is actually just a wrapper for a C api.
> The directory structure looks like this.
> .
>
> |-- Makefile
> |-- extconf.rb
> |-- extconf.rb~
> |-- libmdc.so
> |-- mdc.h
> |-- metadata-backup.c~
> |-- metadata.c
> |-- metadata.c~
> |-- metadata.o
> |-- metadata.so
>
> `-- mkmf.log
>
> When I generate the makefile, it doesn't find libmdc.so. How can I fix
> this?
>
> require 'mkmf'
>
> have_header("mdc.h")
> have_library('libmdc.so','MDOpenConnection')
>
> dir_config('metadata')
> create_makefile('metadata')
>
> When I run it, I get
>
> checking for mdc.h... yes
> checking for MDOpenConnection() in -llibmdc.so... no
> creating Makefile

I'm not sure, but I think you shouldn't put the lib prefix in the call to
have_library:

have_library('mdc', 'MDOpenConnection')

I hope this helps

Stefano

Tristin Davis

7/6/2008 5:27:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

Thanks Stefano, that worked. Now I get this though.

LoadError: libmdc.so: cannot open shared object file: No such file or
directory - ./metadata.so
from ./metadata.so
from (irb):1

I tried setting LD_LIBRARY_PATH to include the directory, but that didn't
work.

On Sun, Jul 6, 2008 at 12:12 PM, Stefano Crocco <stefano.crocco@alice.it>
wrote:

> On Sunday 06 July 2008, Tristin Davis wrote:
> > I have an extension I wrote which is actually just a wrapper for a C api.
> > The directory structure looks like this.
> > .
> >
> > |-- Makefile
> > |-- extconf.rb
> > |-- extconf.rb~
> > |-- libmdc.so
> > |-- mdc.h
> > |-- metadata-backup.c~
> > |-- metadata.c
> > |-- metadata.c~
> > |-- metadata.o
> > |-- metadata.so
> >
> > `-- mkmf.log
> >
> > When I generate the makefile, it doesn't find libmdc.so. How can I fix
> > this?
> >
> > require 'mkmf'
> >
> > have_header("mdc.h")
> > have_library('libmdc.so','MDOpenConnection')
> >
> > dir_config('metadata')
> > create_makefile('metadata')
> >
> > When I run it, I get
> >
> > checking for mdc.h... yes
> > checking for MDOpenConnection() in -llibmdc.so... no
> > creating Makefile
>
> I'm not sure, but I think you shouldn't put the lib prefix in the call to
> have_library:
>
> have_library('mdc', 'MDOpenConnection')
>
> I hope this helps
>
> Stefano
>
>