如何在Linux libgpod和rhythmbox上强制链接
好的,我已经向 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在运行
configure
和make
之前,您需要将LD_RUN_PATH
设置为/usr/local/lib
。这会将/usr/local/lib
作为共享库搜索路径嵌入到可执行文件中。You need to set
LD_RUN_PATH
to/usr/local/lib
before runningconfigure
andmake
. This will embed/usr/local/lib
as a shared library search path into the executable.libgpod.so
指向旧版本的库。libgpod.so
is pointing to the old version of the library.