[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dynamic libraries linking problem with Libtool
From: |
Ralf Wildenhues |
Subject: |
Re: Dynamic libraries linking problem with Libtool |
Date: |
Fri, 7 Mar 2008 20:22:39 +0100 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
Hello Roberto,
* Roberto Rigamonti wrote on Thu, Mar 06, 2008 at 04:23:31PM CET:
> Hi, I've already posted a related question on
> http://www.linuxquestions.org/ today, but it seems that nobody there is
> Libtool-expert so I've decided to crosspost here.
> I've put a detailed explanation of my problem here:
> http://www.linuxquestions.org/questions/programming-9/c-dynamically-loaded-libraries-and-automake-invalid-elf-library-error-626105/
> By the way, the situation is the following: using Autotools and Libtool
> I created a source tree for a project composed of a main program and a
> set of libraries that must be loaded at runtime by the program
> (plugins). Before starting real coding, I decided to write down a test
> program, because I'm not accustomed with Autotools and I had always used
> the traditional hand-compiling and linking against .so libraries.
> Now, as explained thoroughly in the page linked above, I'm faced with a
> .la library that seems to be requested by my main program, but when I
> provide it, the program refuses it because it is a Libtool archive and
> not a ELF file.
If you use dlopen directly, then you should continue to load .so modules
directly. Loading of libtool modules (.la files created with -module)
works when you use libltdl and its lt_dlopen function. libltdl is
documented here:
<http://www.gnu.org/software/libtool/manual/html_node/Using-libltdl.html>
If you want to see a small example package that uses libltdl, besides
what's in the manual, look in the source tree of Libtool in the
tests/mdemo directory (Libtool version 2.2) resp. the mdemo directory
(version 1.5.x). Note that its Makefile.am file is much more
complicated than it would need to be just for a demo, because mdemo is
also used for some tests.
> I'm close to getting insane, it's about 10 hours I'm
> trying to get out of this, and I read a huge number of docs/tutorials on
> the web without result.
Don't get insane by working 10 hours without progress. Ask after a
couple of hours. ;-)
> I've put the whole source tree on the web
> http://digilander.libero.it/optikstorm/3DVisor-0.0.1.tar.bz2 (~250Kb),
> hoping that this helps.
If the above advice does not help you get further, please ask more
specific questions; I might look into the package then.
Cheers,
Ralf