From: REAL <root@mmedia2.kemsu.ru>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] Как правильно использовать shared objects gcc
Date: Wed, 15 Dec 2010 17:16:03 +0600
Message-ID: <4D08A373.6090409@mmedia2.kemsu.ru> (raw)
In-Reply-To: <AANLkTime+GDmr0FOaEdiBLO+fTMCtwSCBaT=3DBGW8QE@mail.gmail.com>
15.12.2010 16:58, Rinat Bikov пишет:
> Имеется ввиду, чтобы при запуске использовалась библиотека
> libname.so.version, а не искалась libname.so?
> Вот так у меня компилируется библиотека:
Вместо вот этого:
> $(CC) -shared -o lib$(LIBNAME).so functions.o StringBuilder.o LibLoader.o -ldl
Используйте вот это:
$(CC) -shared -o lib$(LIBNAME).so.version functions.o StringBuilder.o
LibLoader.o -ldl -Wl,-soname,lib$(LIBNAME).so.version
ln -s lib$(LIBNAME).so.version lib$(LIBNAME).so
>
> Вот такое работает, если есть символьная ссылка /usr/lib/libname.so ->
> libname.so.version:
> $(CC) $(AC) main.o -ldl -o $(EXECNAME) -L. -l$(LIBNAME) -Wl,-rpath,/usr/lib
>
> А как компилировать, чтобы по -lname ставилось в соответствие
> /usr/lib/libname.so.version?
--
REAL aka Евгений Ростовцев, программист ЦНИТ КемГУ
next prev parent reply other threads:[~2010-12-15 11:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 10:58 Rinat Bikov
2010-12-15 11:16 ` REAL [this message]
2010-12-15 12:03 ` Rinat Bikov
2010-12-15 12:23 ` Ivan Fedorov
2010-12-15 12:52 ` Damir Shayhutdinov
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=4D08A373.6090409@mmedia2.kemsu.ru \
--to=root@mmedia2.kemsu.ru \
--cc=devel@lists.altlinux.org \
/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
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git