ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@altlinux.ru>
Subject: Re: [devel] Q: linker & -z defs
Date: Sat, 2 Apr 2005 18:52:07 +0400
Message-ID: <20050402145207.GB18427@basalt.office.altlinux.org> (raw)
In-Reply-To: <20050401204831.GA24191@lrn.ru>

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

Hi,

On Sat, Apr 02, 2005 at 12:48:31AM +0400, Anton D. Kachalov wrote:
> Наткнулся на такую неприятность с pkgconfig + gtk+-2.0.
> $ pkg-config --libs "gtk+-2.0"
> -lgtk-x11-2.0
> 
> $ gcc -shared -o foobar.so -Wl,-z,defs foobar.c -lgtk-x11-2.0
> /tmp/ccML0lkr.o(.text+0x7): In function `foobar':
> : undefined reference to `gdk_x11_display_get_xdisplay'
> collect2: ld returned 1 exit status
> 
> файл foobar.c:
> <кусь>
> extern void gdk_x11_display_get_xdisplay();
> 
> void foobar()
> {
>     gdk_x11_display_get_xdisplay();
> }
> </ьсук>
> 
> если линковаться так:
> $ gcc -shared -o foobar.so foobar.c -lgtk-x11-2.0
> или так:
> $ gcc -shared -o foobar.so -Wl,-z,defs foobar.c -lgtk-x11-2.0 -lgdk-x11-2.0
> то всё пучком.
> 
> Вопрос в следующем, кто неправ?

Обобщённое правило:
Если
ldd -r /usr/lib/libgtk-x11-2.0.so
найдёт что-нибудь undefined, значит, надо фиксить эту библиотеку.
Если не найдёт, значит, фиксить надо твой makefile.


-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2005-04-02 14:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-01 20:48 Anton D. Kachalov
2005-04-01 21:08 ` Yuri N. Sedunov
2005-04-02  7:31   ` Anton D. Kachalov
2005-04-02  8:26     ` Yuri N. Sedunov
2005-04-02 12:59       ` Vitaly Lipatov
2005-04-02 14:52 ` Dmitry V. Levin [this message]
2005-04-03 11:54   ` Anton D. Kachalov
2005-04-03 13:19     ` Vitaly Lipatov
2005-04-03 13:30     ` Dmitry V. Levin
2005-04-03 16:48       ` Anton D. Kachalov
2005-04-03 16:55         ` Dmitry V. Levin
2005-04-03 17:12           ` Anton D. Kachalov
2005-04-21 16:04             ` Yuri N. Sedunov

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=20050402145207.GB18427@basalt.office.altlinux.org \
    --to=ldv@altlinux.org \
    --cc=devel@altlinux.ru \
    /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