如何在Linux libgpod和rhythmbox上强制链接

发布于 2024-10-06 09:13:39 字数 1421 浏览 0 评论 0原文

好的,我已经向 Linux 库添加了一些功能。

然而,即使在“make install”之后,我仍试图确认该程序的功能是否链接到以前的版本。

所以“make install”将我的库放在这里: '/usr/local/lib' 和 '/usr/local/include'

我在配置中使用了以下内容: ./configure --enable-maintainer-mode --enable-uninstalled-build 'CFLAGS=-g -O0' 'CXXFLAGS=-g -O0' 'JFLAGS=-g -O0' 'FFLAGS=-g -O0' CPPFLAGS ='-L /usr/local/lib/ -I /usr/local/include/gpod-1.0/'

出现“找不到符号”和“插件无法加载”

但是当我尝试执行该程序时,当我 ldd 时, 生成的插件如下: 〜/Development/rhythmbox/plugins/ipod/.libs$ ldd libipod.so

linux-gate.so.1 => (0x00d97000)

librhythmbox-core.so.1 => /home/gary/Development/rhythmbox/shell/.libs/librhythmbox core.so.1 (0x009ad000)

libgpod.so.4 => /usr/lib/libgpod.so.4 (0x00509000)

强调重点是因为它显然链接到了错误的库...当我查看 make 文件时,我看到以下内容:

IPOD_CFLAGS = -pthread -I /usr/local/include/gpod-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include /libpng12

IPOD_LIBS = -pthread -L/usr/local/lib -lgpod -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -lpng12 -lgthread-2.0 -lrt -lglib-2.0

因此 CPPFLAGS 被传递到插件,并且在 .deps 中我看到包含正确的头文件... IE:

~/Development/rhythmbox/plugins/ipod/.deps$ less rb-ipod-source.Po | grep gpod

/usr/local/include/gpod-1.0/gpod/itdb.h ../../lib/eel-gconf-extensions.h

/usr/local/include/gpod-1.0/gpod/itdb.h:

Ubuntu 10.10

有什么想法吗?

Ok, I've added some functionality to a linux library.

However even after 'make install' the program I'm trying to confirm functionality is linking to the previous version.

So 'make install' puts my libraries here:
'/usr/local/lib'
and
'/usr/local/include'

I used the following on configure:
./configure --enable-maintainer-mode --enable-uninstalled-build 'CFLAGS=-g -O0' 'CXXFLAGS=-g -O0' 'JFLAGS=-g -O0' 'FFLAGS=-g -O0' CPPFLAGS='-L /usr/local/lib/ -I /usr/local/include/gpod-1.0/'

But when I try to execute the program I get 'Symbol not found' and 'Plugin can not load'

When I ldd the produced plugin so:
~/Development/rhythmbox/plugins/ipod/.libs$ ldd libipod.so

linux-gate.so.1 => (0x00d97000)

librhythmbox-core.so.1 => /home/gary/Development/rhythmbox/shell/.libs/librhythmbox core.so.1 (0x009ad000)

libgpod.so.4 => /usr/lib/libgpod.so.4 (0x00509000)

The emphasis being stressed because it's obviously linking to the wrong library... When I look in the make file I see the following:

IPOD_CFLAGS = -pthread -I/usr/local/include/gpod-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12

IPOD_LIBS = -pthread -L/usr/local/lib -lgpod -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -lpng12 -lgthread-2.0 -lrt -lglib-2.0

So the CPPFLAGS are being passed through to the plugin, and in .deps I see the proper header file being included... IE:

~/Development/rhythmbox/plugins/ipod/.deps$ less rb-ipod-source.Po | grep gpod

/usr/local/include/gpod-1.0/gpod/itdb.h ../../lib/eel-gconf-extensions.h

/usr/local/include/gpod-1.0/gpod/itdb.h:

Ubuntu 10.10

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乙白 2024-10-13 09:13:39

在运行 configuremake 之前,您需要将 LD_RUN_PATH 设置为 /usr/local/lib。这会将 /usr/local/lib 作为共享库搜索路径嵌入到可执行文件中。

You need to set LD_RUN_PATH to /usr/local/lib before running configure and make. This will embed /usr/local/lib as a shared library search path into the executable.

第几種人 2024-10-13 09:13:39

libgpod.so 指向旧版本的库。

libgpod.so is pointing to the old version of the library.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文