如何在新系統上安裝 glib 1.2?
我嘗試在 Ubiuntu 21.04 上安裝 glib 1.2 來執行舊的 c 程序
成功後
./configure --build=i386-linux-gnu --host=i386-linux-gnu
我試試
make
有錯誤:
make check Making check in . make[1]: Wejście do katalogu '/home/a/Pobrane/glib-1.2.0' /bin/sh ./libtool --mode=link gcc -g -O2 -Wall -D_REENTRANT -o libglib.la -rpath /usr/local/lib -version-info 0:0:0 -release 1.2 garray.lo gcache.lo gcompletion.lo gdataset.lo gdate.lo gerror.lo ghash.lo ghook.lo giochannel.lo giounix.lo glist.lo gmain.lo gmem.lo gmessages.lo gmutex.lo gnode.lo gprimes.lo grel.lo gscanner.lo gslist.lo gstrfuncs.lo gstring.lo gtimer.lo gtree.lo gutils.lo rm -fr .libs/libglib.la .libs/libglib.* .libs/libglib-1.2.* *** Warning: This library needs some functionality provided by -lc. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have. gcc -shared -Wl,-soname -Wl,libglib-1.2.so.0 -o .libs/libglib-1.2.so.0.0.0 garray.lo gcache.lo gcompletion.lo gdataset.lo gdate.lo gerror.lo ghash.lo ghook.lo giochannel.lo giounix.lo glist.lo gmain.lo gmem.lo gmessages.lo gmutex.lo gnode.lo gprimes.lo grel.lo gscanner.lo gslist.lo gstrfuncs.lo gstring.lo gtimer.lo gtree.lo gutils.lo /usr/bin/ld: gcache.lo: in function `g_bit_nth_lsf': ... /home/a/Pobrane/glib-1.2.0/glib.h:1560: multiple definition of `g_bit_nth_msf'; garray.lo:/home/a/Pobrane/glib-1.2.0/glib.h:1560: first defined here /usr/bin/ld: gutils.lo: in function `g_bit_storage': /home/a/Pobrane/glib-1.2.0/glib.h:1578: multiple definition of `g_bit_storage'; garray.lo:/home/a/Pobrane/glib-1.2.0/glib.h:1578: first defined here collect2: error: ld returned 1 exit status make[1]: *** [Makefile:296: libglib.la] Błąd 1 make[1]: Opuszczenie katalogu '/home/a/Pobrane/glib-1.2.0' make: *** [Makefile:403: check-recursive] Błąd 1
我用Google搜尋了錯誤資訊,但沒有結果。這是解決方案嗎?
========編輯===
使用 Knud 方法安裝 glib 後
make cc -ansi -Wall -g -I /usr/include/glib-1.2 -I /usr/include/gtk-1.2 -I /usr/lib/glib/include -c julia2.c julia2.c:8:10: fatal error: gtk/gtk.h: Nie ma takiego pliku ani katalogu 8 | #include <gtk/gtk.h> | ^~~~~~~~~~~ compilation terminated. make: *** [makefile:16: julia2.o] Błąd 1
所以編譯沒有錯誤。附加檢查:
find . -name '*.so.*' -type f -exec file {} \; ./snap/brave/121/.config/BraveSoftware/Brave-Browser/WidevineCdm/4.10.2209.0/_platform_specific/linux_x64/libwidevinecdm.so.sig: data ./snap/brave/120/.config/BraveSoftware/Brave-Browser/WidevineCdm/4.10.2209.0/_platform_specific/linux_x64/libwidevinecdm.so.sig: data ./Pobrane/hplip-3.21.6/.libs/libhpmud.so.0.0.6: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=02c7f5f977604305c3a6d6167f8f87455922a882, not stripped ./Pobrane/hplip-3.21.6/.libs/libhpipp.so.0.0.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=46158ce64a378404dc4008aaed0b65f67c4bd4a4, not stripped ./Pobrane/hplip-3.21.6/.libs/libsane-hpaio.so.1.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=5277f7887124074022671d51263eae68e234588c, not stripped ./Pobrane/hplip-3.21.6/.libs/libhpdiscovery.so.0.0.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=3c4d2def464c65586af097c4e06f3c4b13d8b203, not stripped ./Pobrane/hplip-3.21.6/.libs/libhpip.so.0.0.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=297d1bea4175bb34ba1b989a4219c12b7c615fe1, not stripped
但 ldconfig 在 1249 個共享庫之間顯示 libglib 1.2、2.0 和 2.4
ldconfig -p>s.txt ... libglibmm_generate_extra_defs-2.4.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libglibmm_generate_extra_defs-2.4.so.1 libglibmm-2.4.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libglibmm-2.4.so.1 libglib-2.0.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libglib-2.0.so.0 libglib-1.2.so.0 (libc6) => /lib/libglib-1.2.so.0
? 建構 glib-1.2.10 :我認為您無法使用現代作業系統來做到這一點。最新的軟體包是為 Ubuntu 7.04 建構的?2007 年,可能使用 gcc-3.4.6 !
請從“舊 ubuntu”下載 → libglib1.2_1.2.10-17build1_i386.deb http://old-releases.ubuntu.com/ubuntu/pool/main/g/glib1.2/libglib1.2_1.2.10-17build1_i386.deb …和libglib1.2-dev_1.2.10-17build1_i386.deb http://old-releases.ubuntu.com/ubuntu/pool/main/g/glib1.2/libglib1.2-dev_1.2.10-17build1_i386.deb
軟體包安裝正常,Ubuntu 21.04 - amd64
sudo apt install ./libglib1.2_1.2.10-17build1_i386.deb sudo apt install ./libglib1.2-dev_1.2.10-17build1_i386.deb
…並
ldd
確認libglib-1.2.so.0.0.10
OK。PS:2005 年的 gtk-1.2.10 包應該也可以使用http://old-releases.ubuntu.com/ubuntu/pool/main/g/gtk+1.2/
編輯:
libgtk1.2-common:all
重新打包到 :i386 。連結https://drive.google.com/drive/folders/1hRMXw6utPJdpNSZlxiXYIjOK4v3nmIQu?usp=sharing …然後 Ubuntu 21.04 沒有問題