在 CentOS 上安装 GTK+ 3.0.5 时出错
Error when install GTK+ 3.0.5 on CentOS
在 CentOS Linux 7.1.1503 版上从源代码安装 gtk+-3.0.5 时出现以下错误。
错误信息:
/usr/bin/ld: queryimmodules.o: undefined reference to symbol
'g_module_close' /usr/bin/ld: note: 'g_module_close' is defined in DSO
/lib64/libgmodule-2.0.so.0 so try adding it to the linker command line
/lib64/libgmodule-2.0.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
环境:
[root@localhost gtk+-3.0.5]# cat /etc/*release CentOS Linux release
7.1.1503 (Core)
CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"
CentOS Linux release 7.1.1503 (Core) CentOS Linux release 7.1.1503
(Core)
[root@localhost gtk+-3.0.5]# uname -a Linux localhost.localdomain
3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
./configure --prefix=/opt/gtk
GTK+ 3.0.5
GDK backends: x11 X11 extensions: XKB XI2 XFIXES DAMAGE
Print backends: file lpr Dynamic modules: yes Included
immodules: none PackageKit support: yes Introspection: no
Debugging: minimum Documentation: no
制作
... CCLD libgtk-3.la CC queryimmodules.o CCLD
gtk-query-immodules-3.0 /usr/bin/ld: queryimmodules.o: undefined
reference to symbol 'g_module_close' /usr/bin/ld: note:
'g_module_close' is defined in DSO /lib64/libgmodule-2.0.so.0 so try
adding it to the linker command line /lib64/libgmodule-2.0.so.0: could
not read symbols: Invalid operation collect2: error: ld returned 1
exit status make[4]: * [gtk-query-immodules-3.0] Error 1 make[4]:
Leaving directory /root/gtk/gtk+-3.0.5/gtk' make[3]: ***
[all-recursive] Error 1 make[3]: Leaving directory
/root/gtk/gtk+-3.0.5/gtk' make[2]: * [all] Error 2 make[2]: Leaving
directory /root/gtk/gtk+-3.0.5/gtk' make[1]: *** [all-recursive]
Error 1 make[1]: Leaving directory
/root/gtk/gtk+-3.0.5' make: ***
[all] Error 2
# yum install gtk3-devel
... 将提供版本 -3.8.8-10.el7
?为什么要使用旧版本?时间戳 = 2011 年 3 月 23 日!
在 CentOS Linux 7.1.1503 版上从源代码安装 gtk+-3.0.5 时出现以下错误。
错误信息:
/usr/bin/ld: queryimmodules.o: undefined reference to symbol 'g_module_close' /usr/bin/ld: note: 'g_module_close' is defined in DSO /lib64/libgmodule-2.0.so.0 so try adding it to the linker command line /lib64/libgmodule-2.0.so.0: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status
环境:
[root@localhost gtk+-3.0.5]# cat /etc/*release CentOS Linux release 7.1.1503 (Core)
CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"
CentOS Linux release 7.1.1503 (Core) CentOS Linux release 7.1.1503 (Core)
[root@localhost gtk+-3.0.5]# uname -a Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
./configure --prefix=/opt/gtk
GTK+ 3.0.5
GDK backends: x11 X11 extensions: XKB XI2 XFIXES DAMAGE Print backends: file lpr Dynamic modules: yes Included immodules: none PackageKit support: yes Introspection: no Debugging: minimum Documentation: no
制作
... CCLD libgtk-3.la CC queryimmodules.o CCLD
gtk-query-immodules-3.0 /usr/bin/ld: queryimmodules.o: undefined reference to symbol 'g_module_close' /usr/bin/ld: note: 'g_module_close' is defined in DSO /lib64/libgmodule-2.0.so.0 so try adding it to the linker command line /lib64/libgmodule-2.0.so.0: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status make[4]: * [gtk-query-immodules-3.0] Error 1 make[4]: Leaving directory/root/gtk/gtk+-3.0.5/gtk' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory
/root/gtk/gtk+-3.0.5/gtk' make[2]: * [all] Error 2 make[2]: Leaving directory/root/gtk/gtk+-3.0.5/gtk' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory
/root/gtk/gtk+-3.0.5' make: *** [all] Error 2
# yum install gtk3-devel
... 将提供版本 -3.8.8-10.el7
?为什么要使用旧版本?时间戳 = 2011 年 3 月 23 日!