freebsd equiv of libdl.a (load shared libs)

2008-03-26 Thread Steve Franks
I am porting a linux app which is looking for libdl.a (which I
understand from googling is related to loading of shared libs).  The
app makes a libusb-based shared lib.  FreeBSD uses shared libs, so I
assume there is equivalent functionality somewhere.  I also see
libdl.a in /compat/linux/lib, but I assume if I link a native FreeBSD
app against this, fireworks will be the only result.  I further assume
since I got no error from gcc, that some freebsd header actally points
to the exact functions expected in libdl.a, so they are in there
somewhere

Steve

-- 
Steve Franks, KE7BTE
Staff Engineer
La Palma Devices, LLC
http://www.lapalmadevices.com
(520) 312-0089
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: solved freebsd equiv of libdl.a (load shared libs)

2008-03-26 Thread Steve Franks
On Wed, Mar 26, 2008 at 2:39 PM, Steve Franks [EMAIL PROTECTED] wrote:
 I am porting a linux app which is looking for libdl.a (which I
  understand from googling is related to loading of shared libs).  The
  app makes a libusb-based shared lib.  FreeBSD uses shared libs, so I
  assume there is equivalent functionality somewhere.  I also see
  libdl.a in /compat/linux/lib, but I assume if I link a native FreeBSD
  app against this, fireworks will be the only result.  I further assume
  since I got no error from gcc, that some freebsd header actally points
  to the exact functions expected in libdl.a, so they are in there
  somewhere

  Steve

  --
  Steve Franks, KE7BTE
  Staff Engineer
  La Palma Devices, LLC
  http://www.lapalmadevices.com
  (520) 312-0089


Looks like changing -ldl to -lc (libc.a) to the link step in my
makefile did it.  No idea why they weren't picking that up...

Steve


-- 
Steve Franks, KE7BTE
Staff Engineer
La Palma Devices, LLC
http://www.lapalmadevices.com
(520) 312-0089
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: freebsd equiv of libdl.a (load shared libs)

2008-03-26 Thread Dan Nelson
In the last episode (Mar 26), Steve Franks said:
 I am porting a linux app which is looking for libdl.a (which I
 understand from googling is related to loading of shared libs).  The
 app makes a libusb-based shared lib.  FreeBSD uses shared libs, so I
 assume there is equivalent functionality somewhere.  I also see
 libdl.a in /compat/linux/lib, but I assume if I link a native FreeBSD
 app against this, fireworks will be the only result.  I further
 assume since I got no error from gcc, that some freebsd header
 actally points to the exact functions expected in libdl.a, so they
 are in there somewhere

The dlopen/dlsym functions are built into libc on FreeBSD, so there's
no need for a libdl:


DLOPEN(3)  FreeBSD Library Functions Manual  DLOPEN(3)

NAME
 dlopen, dlsym, dlfunc, dlerror, dlclose -- programmatic interface to the
 dynamic linker

LIBRARY
 Standard C Library (libc, -lc)


-- 
Dan Nelson
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: solved freebsd equiv of libdl.a (load shared libs)

2008-03-26 Thread mdh
--- Steve Franks [EMAIL PROTECTED] wrote:

 On Wed, Mar 26, 2008 at 2:39 PM, Steve Franks
 [EMAIL PROTECTED] wrote:
  I am porting a linux app which is looking for
 libdl.a (which I
   understand from googling is related to loading of
 shared libs).  The
   app makes a libusb-based shared lib.  FreeBSD
 uses shared libs, so I
   assume there is equivalent functionality
 somewhere.  I also see
   libdl.a in /compat/linux/lib, but I assume if I
 link a native FreeBSD
   app against this, fireworks will be the only
 result.  I further assume
   since I got no error from gcc, that some freebsd
 header actally points
   to the exact functions expected in libdl.a, so
 they are in there
   somewhere
 
   Steve
 
   --
   Steve Franks, KE7BTE
   Staff Engineer
   La Palma Devices, LLC
   http://www.lapalmadevices.com
   (520) 312-0089
 
 
 Looks like changing -ldl to -lc (libc.a) to the link
 step in my
 makefile did it.  No idea why they weren't picking
 that up...
 
 Steve

You don't need -lc.  C compilers link in libc
regardless.  You may also want to consider letting it
load dynamically at runtime rather than linking the
static .a file at compile-time.  

Chances are what it was looking for was dlopen() and
friends, which are in libc on FreeBSD.  They are a
part of libc on my Linux systems as well though, so
not sure why it'd be trying to link against another
library, though admittedly I know a lot more about
development for FreeBSD than for Linux.  
- mdh



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]