On Fri, Jul 28, 2000 at 02:00:15PM -0700, Tom Matelich wrote:
>
> Hello,
>
> I am going to be implementing a plug-in system for a C++
> application that needs to run on Linux, HP-UX, and Windows. I see
> that libltdl will load shared libraries for each of these platforms,
> but I have a few questions.
>
> 1) There is the warning about using C++ because of the various
> name mangling issues. I think I would be fine as long as the
> libraries are from the same compiler, right? Or do I have to extern
> "C" the functions I would use?
You must add libltdl to your C++ project with ``libtoolize --ltdl'',
and have you project subconfigure that directory by adding
``AC_CONFIG_SUBDIRS(libltdl)'' to your top-level configure. libltdl
will be built in the libltdl subdirectory with the C compiler, but the
header is robust to being read by a C++ compiler so that is fine.
As far as using lt_dlsym() is concerned, I think you are correct in
saying that the mangling issues are transparent to libltdl provided
that the mopdules you load are compiled by the same compiler as the
application.
> 2) Also, it talks about needing to use libtool on the modules,
> is that required in general or just for when you want to reopen the
> shared lib?
That is not quite true... libltdl is able to load and access symbols
from a shared library compiled without libtool, provided that the
native dynamic loading library is able to do so. That is, if you
don't care about preopening modules, libltdl will be able to load non
libtool compiled modules.
> 3) How do I build the library on Windows assuming this is a
> feasible solution, and are there any special things I have to do to my
> DLL's?
It is hairy.
The snprintfv and m4 tarballs on my webpages both use libltdl to load
dll's on windows. You should pick at them to see how it can be done.
> Thanks for your time,
Thanks for your interest =)O|
> Tom Matelich
Cheers,
Gary.
--
___ _ ___ __ _ mailto: [EMAIL PROTECTED]
/ __|__ _ _ ___ _| | / / | / /_ _ _ _ __ _| |_ __ _ ___ [EMAIL PROTECTED]
| (_ / _` | '_|// / |/ /| |/ / _` | || / _` | ' \/ _` | _ \
\___\__,_|_|\_, /|___(_)___/\__,_|\_,_\__, |_||_\__,_|//_/
home page: /___/ /___/ gpg public key:
http://www.oranda.demon.co.uk http://www.oranda.demon.co.uk/key.asc