linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Progga <abulfazl@juniv.edu>
To: wrazlov@gmx.net, linux-c-programming@vger.kernel.org
Subject: Re: dynamic linking
Date: Mon, 9 Sep 2002 20:39:39 +0000	[thread overview]
Message-ID: <200209092039.39308.abulfazl@juniv.edu> (raw)
In-Reply-To: <200209091306.17099.wrazlov@gmx.net>

[-- Attachment #1: Type: text/plain, Size: 638 bytes --]

On Monday 09 Sep 2002 11:06 am, Wrazlov wrote:
> > Hi,
> > I'm new to this list and actually didn't read the faq but man dlopen is
> > your friend.
> > After dlopening you need to dlsym the 'entry point' of your plugin
>
> Thanks for that, but that's only one part, for I don't know how to compile
> such a lib.so?
> Is it possible to import let's say a class using dlopen?
>

    Please see whether libtool and libltdl can help you. I just had a glimpse 
of "$info libtool". 

Khoda Hafez
Progga

** I once learned to use "libtool"  and wrote a nano manual for future  
   reference. I have attached it with the mail.

[-- Attachment #2: LIBTOOL.TXT --]
[-- Type: text/plain, Size: 1960 bytes --]




                                 Manual de libtool
                            ***************************
                                     ( 1.0 )


                "libtool" is the programme for creating static and shared libraries .

   It's part of the GNU binutils ( Binary Utilities ) . The tool for creating Dynamic

   linker libraries is "dlltool" which isn't present in the Redhat Linux 7.0

   distribution .



         To create a static library , do the following :


         $ c++ -c del.c++  ( this will create del.o - the object code )


         $ ar cru libdel.a del.o   ( this will create libdel.a - the static library )

         $ ranlib libdel.a   ( this will test libdel.a )




         To create a shared library , do the following :



         $ libtool c++ -c del.c++  ( this will create del.lo )

         $ libtool c++ -o libdel.la del.lo -rpath /usr/lib

        ( this will create libdel.la and libdel.so , libdel.so.0 etc in the .libs

          directory which is hidden . )



          Now copy the libdel.so , libdel.so.0 and libdel.so.0.0.0 to the /usr/lib

  directory . The  "-rpath" option is needed to create the *.so files , though it

  won't place them in the /usr/lib directory . It's a good practice to test the del.c++

  file before making it a shared or static library by combining it with any C++ file

  having the main function . The strace utility can be a handy tool to watch the linking

  process if anything goes wrong . Various libraries are located in the /usr/lib/*

  directories and are loaded successfully while execution takes place , but I have

  so far failed to use this feature . So the new libraries must be placed in the /usr/lib

  or the /lib directory instead of /usr/lib/* or /lib/* directories .




  ** To use strace write "$ strace executive_file_name " and press enter .


  *** The argument for "-rpath" option can be any valid pathname instead of /usr/lib .











      parent reply	other threads:[~2002-09-09 20:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-08 20:00 dynamic linking Wrazlov
2002-09-08 20:03 ` Wrazlov
2002-09-08 21:06   ` Holger Freyther
2002-09-09 11:06     ` Wrazlov
2002-09-09 14:24       ` Glynn Clements
2002-09-11 15:43         ` Jan-Benedict Glaw
2002-09-09 20:39       ` Progga [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200209092039.39308.abulfazl@juniv.edu \
    --to=abulfazl@juniv.edu \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=wrazlov@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).