comp.lang.ada
 help / color / mirror / Atom feed
* Gtkada link problem
@ 2020-07-05 14:57 hreba
  2020-07-05 18:56 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 3+ messages in thread
From: hreba @ 2020-07-05 14:57 UTC (permalink / raw)


I installed GNAT 2020 from Adacore together with Gtkada on a PC running 
Linux Mint.
I downloaded Dmitry's Gtkada_Contributions as source file.
When I build his Test_Gtk_Tasking example as standalone unit, it 
compiles, links and runs. But I have a linker problem  when I use it as 
a static library.

My directory structure is
|
+ Aux
| + lib
| + obj
| + aux.ads
| + aux.adb
| + aux.gpr
|
+ Main
| + obj
| + main.adb
| + main.gpr
|
main.adb:
--------
with Aux;
procedure Main is
begin
    Aux.Test_Gtk_Tasking;
end Main;

aux.ads:
-------
package Aux is
    procedure Test_Gtk_Tasking;
end Aux;

aux.adb:
-------
<Dmitry's with clauses>
package body Aux is
<Dmitry's procedure Test_Gtk_Tasking>
end Aux;

aux.gpr:
-------
with "gtkada";
with "/home/frank/Lib/Ada/gtkada_contributions/gtkada_contributions";

library project Aux is

    for Library_Name use "aux";
    for Source_Dirs use (".");
    for Object_Dir use "obj";
    for Library_Dir use "lib";
    for Library_Kind use "static";
    for Library_Interface use ("Aux");
    for externally_built use "false";

end Aux;

main.gpr:
--------
with "../Aux/aux";

project Main is
    for Source_Dirs use (".");
    for Object_Dir use "obj";
    for Exec_Dir use ".";
    for Main use ("main.adb");

    package Linker is
       for Default_Switches ("Ada") use ("-L../Aux/lib", "-laux");
    end Linker;

end Main;

Upon gprbuild everything compiles and then comes a list of "undefined 
reference errors terminating in

/opt/GNAT/2020/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.3.1/ld: 
/home/frank/Exercises/Ada/Gtkada_Contrib/Aux/lib/libaux.a(p__aux_0.o):(.gcc_except_table+0x94): 
undefined reference to `gtk__main__router__quit_error'

nm Aux/lib/libaux.a contains mainly lines beginning with 'U' (undefined 
symbol).

I am pretty sure that I just need some linker switches and that the 
above ones are useless.

Any help?
-- 
Frank Hrebabetzky, Kronach	+49 / 9261 / 950 0565

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Gtkada link problem
  2020-07-05 14:57 Gtkada link problem hreba
@ 2020-07-05 18:56 ` Dmitry A. Kazakov
  2020-07-06 10:49   ` hreba
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry A. Kazakov @ 2020-07-05 18:56 UTC (permalink / raw)


On 05/07/2020 16:57, hreba wrote:

> I am pretty sure that I just need some linker switches and that the 
> above ones are useless.
> 
> Any help?

Static GTK/GtkAda linkage stopped working long ago. Since then I never 
tried to revive it. I do not remember the exact problem it was something 
to do with GTK licensing, but I might be wrong.

If you find a way let me know, however I think it does not worth the 
efforts.

Because if you hope to create a self-contained GTK application with will 
not work. GTK requires literally thousands of files like fonts, themes 
etc to work. If you manage to link it statically and eliminate shared 
libraries you sill won't be able to deploy it as a single file.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Gtkada link problem
  2020-07-05 18:56 ` Dmitry A. Kazakov
@ 2020-07-06 10:49   ` hreba
  0 siblings, 0 replies; 3+ messages in thread
From: hreba @ 2020-07-06 10:49 UTC (permalink / raw)


On 05.07.20 20:56, Dmitry A. Kazakov wrote:
> On 05/07/2020 16:57, hreba wrote:
> 
>> I am pretty sure that I just need some linker switches and that the 
>> above ones are useless.
>>
>> Any help?
> 
> Static GTK/GtkAda linkage stopped working long ago. Since then I never 
> tried to revive it. I do not remember the exact problem it was something 
> to do with GTK licensing, but I might be wrong.
> 
> If you find a way let me know, however I think it does not worth the 
> efforts.
> 
> Because if you hope to create a self-contained GTK application with will 
> not work. GTK requires literally thousands of files like fonts, themes 
> etc to work. If you manage to link it statically and eliminate shared 
> libraries you sill won't be able to deploy it as a single file.
> 

As static is the default and stands in all examples, I left it this way 
for laziness. No problem to change it. Thanks for the answer.
-- 
Frank Hrebabetzky, Kronach	+49 / 9261 / 950 0565

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-06 10:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05 14:57 Gtkada link problem hreba
2020-07-05 18:56 ` Dmitry A. Kazakov
2020-07-06 10:49   ` hreba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox