3

I try to install gtk 1.2 on Ubuntu 21.04 to run old c program.

After succesfull installing glib 1.2 ( with help of experts )

I have installed gtk 1.2 using modified files provided by Knud

sudo apt install ./libgtk1.2-common_1.2.10-18_i386.deb
[sudo] hasło użytkownika a: 
Czytanie list pakietów... Gotowe
Budowanie drzewa zależności... Gotowe
Odczyt informacji o stanie... Gotowe   
Uwaga, wybieranie "libgtk1.2-common:i386" zamiast "./libgtk1.2-common_1.2.10-18_i386.deb"
libgtk1.2-common:i386 is already the newest version (1.2.10-18).
0 aktualizowanych, 0 nowo instalowanych, 0 usuwanych i 0 nieaktualizowanych.

sudo apt install ./libgtk1.2_1.2.10-18_i386.deb
Czytanie list pakietów... Gotowe
Budowanie drzewa zależności... Gotowe
Odczyt informacji o stanie... Gotowe   
Uwaga, wybieranie "libgtk1.2:i386" zamiast "./libgtk1.2_1.2.10-18_i386.deb"
Następujące pakiety zostały zainstalowane automatycznie i nie są już więcej wymagane:
  libpthread-stubs0-dev:i386 libx11-dev:i386 libxau-dev:i386 libxcb1-dev:i386
  libxdmcp-dev:i386 libxext-dev:i386 libxfixes-dev:i386 libxi-dev:i386
  x11proto-input-dev
Aby je usunąć należy użyć "sudo apt autoremove".
Następujące pakiety zostaną USUNIĘTE:
  libgtk1.2-dev:i386
Następujące pakiety zostaną zaktualizowane:
  libgtk1.2:i386
1 aktualizowanych, 0 nowo instalowanych, 1 usuwanych i 0 nieaktualizowanych.
Konieczne pobranie 0 B/837 kB archiwów.
Po tej operacji zostanie zwolnione 3 822 kB miejsca na dysku.
Kontynuować? [T/n] t
Pobieranie:1 /home/a/Pobrane/gtk/knud/libgtk1.2_1.2.10-18_i386.deb libgtk1.2 i386 1.2.10-18 [837 kB]
(Odczytywanie bazy danych ... 216199 plików i katalogów obecnie zainstalowanych.
)
Usuwanie pakietu libgtk1.2-dev:i386 (1.2.10-17build1) ...
(Odczytywanie bazy danych ... 215939 plików i katalogów obecnie zainstalowanych.
)
Przygotowywanie do rozpakowania pakietu .../libgtk1.2_1.2.10-18_i386.deb ...
Rozpakowywanie pakietu libgtk1.2:i386 (1.2.10-18) nad (1.2.10-17build1) ...
Konfigurowanie pakietu libgtk1.2:i386 (1.2.10-18) ...
Przetwarzanie wyzwalaczy pakietu man-db (2.9.4-2)...
Przetwarzanie wyzwalaczy pakietu libc-bin (2.33-0ubuntu5)...
N: Download is performed unsandboxed as root as file '/home/a/Pobrane/gtk/knud/libgtk1.2_1.2.10-18_i386.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Brak dostępu)
a@zalman:~/Pobrane/gtk/knud$ sudo apt install ./libgtk1.2_1.2.10-18_i386.deb
Czytanie list pakietów... Gotowe
Budowanie drzewa zależności... Gotowe
Odczyt informacji o stanie... Gotowe   
Uwaga, wybieranie "libgtk1.2:i386" zamiast "./libgtk1.2_1.2.10-18_i386.deb"
libgtk1.2:i386 is already the newest version (1.2.10-18).
Następujące pakiety zostały zainstalowane automatycznie i nie są już więcej wymagane:
  libpthread-stubs0-dev:i386 libx11-dev:i386 libxau-dev:i386 libxcb1-dev:i386 libxdmcp-dev:i386 libxext-dev:i386 libxfixes-dev:i386
  libxi-dev:i386 x11proto-input-dev
Aby je usunąć należy użyć "sudo apt autoremove".
0 aktualizowanych, 0 nowo instalowanych, 0 usuwanych i 0 nieaktualizowanych.

Check :

ldconfig -p

libgtksourceview-4.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgtksourceview-4.so.0
    libgtkmm-3.0.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
    libgtk-3.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgtk-3.so.0
    libgtk-1.2.so.0 (libc6) => /lib/libgtk-1.2.so.0
    libgtk-x11-2.0.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0

So now I can compile the program

make
/usr/bin/gcc -std=gnu89 -Wall -g -I /usr/include/glib-1.2 -I /usr/include/gtk-1.2 -I /usr/lib/glib/include  -o julia2 complex.o imagearea.o zero.o cpoly.o julia2.o `gtk-config --cflags` `gtk-config --libs` -lgthread
/bin/sh: 1: gtk-config: not found
/bin/sh: 1: gtk-config: not found
/ usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libgthread.so when -lgthread is searched
/ usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libgthread.a when looking for -lgthread
/ usr / bin / ld: leave incompatible /lib/../lib/libgthread.so when -lgthread is searched
/ usr / bin / ld: leave incompatible /lib/../lib/libgthread.a when -lgthread is searched
/ usr / bin / ld: leave incompatible /usr/lib/../lib/libgthread.so when -lgthread is searched
/ usr / bin / ld: leave incompatible /usr/lib/../lib/libgthread.a when looking for -lgthread
/ usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../libgthread.so when -lgthread is searched
/ usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../libgthread.a when -lgthread is searched
/ usr / bin / ld: leave incompatible /lib/libgthread.so when -lgthread is searched
/ usr / bin / ld: leave incompatible /lib/libgthread.a when -lgthread is searched
/ usr / bin / ld: leave incompatible /usr/lib/libgthread.so when -lgthread is searched
/ usr / bin / ld: leave incompatible /usr/lib/libgthread.a when -lgthread is searched
/ usr / bin / ld: cannot find -lgthread
/ usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libgthread.so when -lgthread is searched
/ usr / bin / ld: leave incompatible /lib/../lib/libgthread.so when -lgthread is searched
/ usr / bin / ld: leave incompatible /usr/lib/../lib/libgthread.so when -lgthread is searched
/ usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../libgthread.so when -lgthread is searched
/ usr / bin / ld: leave incompatible /lib/libgthread.so when -lgthread is searched
/ usr / bin / ld: leave incompatible /usr/lib/libgthread.so when -lgthread is searched
collect2: error: ld returned 1 exit status
make: *** [makefile:13: julia2] Błąd 1

Manual check shows that ther is no "/usr/include/gtk-1.2" directory

Should I install dev package ?

============ edit =====================

Installing dev package :

sudo apt install ./libgtk1.2-dev_1.2.10-18_i386.deb
Czytanie list pakietów... Gotowe
Budowanie drzewa zależności... Gotowe
Odczyt informacji o stanie... Gotowe   
Uwaga, wybieranie "libgtk1.2-dev:i386" zamiast "./libgtk1.2-dev_1.2.10-18_i386.deb"
libgtk1.2-dev:i386 is already the newest version (1.2.10-18).
0 aktualizowanych, 0 nowo instalowanych, 0 usuwanych i 0 nieaktualizowanych.

1 Answer 1

4

Yes, you need to install the relevant -dev packages (for Gtk and Glib and their dependencies).

If you’re intending to build all the programs you want to run with old versions of these libraries, you might find it easier to install the amd64 versions instead of the i386 versions; that would avoid the hassle of dealing with the -common package on both architectures.

11
  • Still the similar after make : / usr / bin / ld: leave incompatible /usr/lib/libgtk.so when -lgtk is searched Commented Jul 18, 2021 at 10:49
  • Yes, that’s because you’re building a 64-bit binary but have installed the 32-bit libraries. Commented Jul 18, 2021 at 11:35
  • 2
    Link, julia2-bin_glib1.2-gtk1.2_amd64.tar.xz drive.google.com/file/d/1M8RXwCeryay99gyZLQeE3dKZACncZyYX/… Commented Jul 18, 2021 at 12:43
  • 1
    Why multilib ? ? Julia2 builds OK with any 64bits gcc, it seems. ..... Also Ubuntu 21.04 drive.google.com/drive/folders/… Commented Jul 18, 2021 at 13:55
  • 1
    Packages from archive.debian.org/debian-archive/debian/pool/main/g are free, and yes you can copy Debian (or Ubuntu) packages (or links) to github. License info is included in the packages. Commented Jul 18, 2021 at 14:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.