ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Rinat Bikov <becase@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: [devel] Как правильно использовать shared objects gcc
Date: Wed, 15 Dec 2010 13:58:22 +0300
Message-ID: <AANLkTime+GDmr0FOaEdiBLO+fTMCtwSCBaT=3DBGW8QE@mail.gmail.com> (raw)

Здравствуйте!
Можете подсказать, как у нас правильно компилировать C-программы с
использованием динамических библиотек, учитывая то, что используемая
библиотека поставляется с программой?
Имеется ввиду, чтобы при запуске использовалась библиотека
libname.so.version, а не искалась libname.so?
Вот так у меня компилируется библиотека:
$(CC) -shared -o lib$(LIBNAME).so functions.o StringBuilder.o LibLoader.o -ldl

Вот такое работает, если есть символьная ссылка /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?

-- 
С уважением, Ринат Биков.

             reply	other threads:[~2010-12-15 10:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15 10:58 Rinat Bikov [this message]
2010-12-15 11:16 ` REAL
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='AANLkTime+GDmr0FOaEdiBLO+fTMCtwSCBaT=3DBGW8QE@mail.gmail.com' \
    --to=becase@altlinux.org \
    --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