AdaCore / gtkada

Ada bindings for the GTK+ graphical library.
Other
88 stars 20 forks source link

Failure to compile from git due to gdialog link attempting to link to static gtk libraries which do not exist #42

Closed srb623 closed 2 years ago

srb623 commented 2 years ago

I am trying to compile Gtk/Ada from git and when it attempts to link the gdialog program it fails due to the fact that it is trying to link it statically when the gtk libraries on my system (Debian/testing) do not have any static versions of the libraries - only shared. Hence the failure as per the below. Is there a way of skipping the static build so that the entire build will work ? I tried using --disable-static and it fails with an error re building with -fPIC. I then tried to set CFLAGS and LDFLAGS to this and it still fails. My configure is as below:

./configure --prefix=/opt/ides/gnat/gtk-ada/development --enable-shared --with-GL=no --enable-build=Production

Bind [gprbind] gdialog.bexch [Ada] gdialog.ali Link [link] gdialog.adb /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: cannot find -lgtk-3 /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: cannot find -lgdk-3 /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: cannot find -lpangocairo-1.0 /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: cannot find -lpango-1.0 /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: cannot find -latk-1.0 /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: cannot find -lgdk_pixbuf-2.0 /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.a(gmodule.c.o): in function g_module_open_full': (.text+0x5b8): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: /usr/lib/x86_64-linux-gnu/libgio-2.0.a(glocalfileinfo.c.o): in function_g_local_file_info_get': (.text+0x36ec): warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: /usr/lib/x86_64-linux-gnu/libglib-2.0.a(gutils.c.o): in function g_get_user_database_entry': (.text+0x287): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: (.text+0xe0): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: /usr/lib/x86_64-linux-gnu/libgio-2.0.a(glocalfileinfo.c.o): in functionlookup_uid_data': (.text+0x1184): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: /usr/lib/x86_64-linux-gnu/libgio-2.0.a(ginetsocketaddress.c.o): in function g_inet_socket_address_new_from_string': (.text+0x9ac): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: /usr/lib/x86_64-linux-gnu/libgio-2.0.a(gnetworkaddress.c.o): in functiong_network_address_parse': (.text+0x1803): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /opt/ides/gnat/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: (.text+0x181d): warning: Using 'endservent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking collect2: error: ld returned 1 exit status gprbuild: link of gdialog.adb failed gprbuild: failed command was: /opt/ides/gnat/2021/bin/gcc gdialog.o b__gdialog.o /home/xxxxx/Programs/Development-Tools/GNAT/gtk-ada/src/lib/gtkada/static/libgtkada.a -L/home/xxxxx/Programs/Development-Tools/GNAT/gtk-ada//lib -L/home/xxxxx/Programs/Development-Tools/GNAT/gtk-ada//bin -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lfontconfig -lfreetype -L/home/xxxxx/Programs/Development-Tools/GNAT/gtk-ada/src/obj/tools/ -L/home/xxxxx/Programs/Development-Tools/GNAT/gtk-ada/src/obj/tools/ -L/home/xxxxx/Programs/Development-Tools/GNAT/gtk-ada/src/lib/gtkada/static/ -L/opt/ides/gnat/2021/lib/gcc/x86_64-pc-linux-gnu/10.3.1/adalib/ -static -shared-libgcc /opt/ides/gnat/2021/lib/gcc/x86_64-pc-linux-gnu/10.3.1/adalib/libgnat.a -ldl -Wl,-rpath-link,/opt/ides/gnat/2021/lib/gcc/x86_64-pc-linux-gnu/10.3.1//adalib -Wl,-z,origin,-rpath,$ORIGIN/../../..//lib:$ORIGIN/../../..//bin:$ORIGIN/:$ORIGIN/../..//lib/gtkada/static:/opt/ides/gnat/2021/lib/gcc/x86_64-pc-linux-gnu/10.3.1/adalib -o gtkada-dialog make: *** [Makefile:81: tools] Error 4

srb623 commented 2 years ago

Discovered that I had an issue with my toolchain which became apparent when I was trying to build the GNAT collections. Sorry if I have wasted any time. Builds and installs fine now.