Loading ...
Sorry, an error occurred while loading the content.

Re: [blug-prog] Linking Libraries

Expand Messages
  • MMH
    gcc -o config -Wall -I/home/vpopmail/include -I/usr/src/include mail.c -L/home/vpopmail/lib -lvpopmail -Wl,-Bstatic -lnewt -Wl,-Bdynamic -lmysqlclient Add
    Message 1 of 1 , Oct 10, 2001
    View Source
    • 0 Attachment
      gcc -o config -Wall -I/home/vpopmail/include
      -I/usr/src/include mail.c \
      -L/home/vpopmail/lib -lvpopmail -Wl,-Bstatic -lnewt
      -Wl,-Bdynamic -lmysqlclient

      Add "-Wl,-Bstatic" before the libraries you want to link
      statically and "-Wl,-Bdynamic" before the libraries you want
      to link dynamically.

      MMH

      "man gcc" or "info gcc" and "man ld" might help more !!

      Dushyanth Harinath wrote:
      > Hi folks,
      >
      > I have written a small program using newt,mysql and vpopmail libraries.
      >
      > Now iam linking all of them dynamically while compiling using this command
      >
      > gcc -o config -Wall -I/home/vpopmail/include -I/usr/src/include mail.c \
      > -L/home/vpopmail/lib -lvpopmail -lnewt -lmysqlclient
      >
      > How can i link only the newt library statically and the rest of the
      > libraries dynamically.
      >
      > Hope the question is clear enough to understand my problem.. :)
      >
      > TIA
      > cheers
      > dushyanth
      > --
      > The best thing about GNU/Linux | Dushyanth Harinath
      > is the people who use it. | Archean Infotech
      > -Kenneth W. Melvin | www.archeanit.com
      >
      >
      >
      >
      >
      >
      > -----------------------------------------
      > This email was sent using SquirrelMail.
      > "Webmail for nuts!"
      > http://squirrelmail.org/
      >
      >
      >
      > *Yahoo! Groups Sponsor*
      > <http://us.a1.yimg.com/us.yimg.com/a/ve/verisign/vsopen24.gif>
      > <http://rd.yahoo.com/M=212180.1660613.3195489.1269402/D=egroupweb/S=1705006580:HM/A=812074/R=0/*http://www.verisign.com/cgi-bin/go.cgi?a=b153340270003000>
      >
      >
      >
      > --
      > ---------------------------------------------------------------
      > This is the programming list of the Bangalore Linux Users Group
      > ---------------------------------------------------------------
      > Go to http://linux-bangalore.org for more information
      > about us, as well as our other mailing lists
      >
      >
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
      > <http://docs.yahoo.com/info/terms/>.
    Your message has been successfully submitted and would be delivered to recipients shortly.