Compile GtkAda

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Compile GtkAda

Adam Puleo
Hello,

I’m trying to compile GtkAda on macOS using Gnat 2018.

Configure (CC=/usr/bin/gcc ./configure --prefix=/usr/local) completed successfully.

Make fails with the following messages:
   [Ada]          pango-layout.adb
   [Ada]          gtk-tearoff_menu_item.adb
   [Ada]          glib-string.adb
   [C]            misc.c
   [C]            misc_generated.c
Build Libraries
   [gprlib]       gtkada.lexch
   [archive]      libgtkada.a
   [index]        libgtkada.a
====== Building static-pic libraries =====
/Users/adampuleo/opt/GNAT/2018/bin/gprbuild  -j0 -m -p  -XLIBRARY_TYPE=static-pic -Psrc/gtkada.gpr
====== Building relocatable libraries =====
/Users/adampuleo/opt/GNAT/2018/bin/gprbuild  -j0 -m -p  -XLIBRARY_TYPE=relocatable -Psrc/gtkada.gpr
Build Libraries
   [gprlib]       gtkada.lexch
   [link library] libgtkada.dylib
ld: warning: directory not found for option '-L/Users/adampuleo/Documents/programs/gtkada//lib'
ld: warning: directory not found for option '-L/Users/adampuleo/Documents/programs/gtkada//bin'
ld: unknown option: -Wl
collect2: error: ld returned 1 exit status
gprlib: /users/adampuleo/opt/gnat/2018/bin/gcc execution error
gprbuild: could not build library for project gtkada
make: *** [Makefile:85: build_library_type/relocatable] Error 4

I’m unsure on how to proceed on troubleshooting this.

Any ideas?

Thanks,
-Adam


_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada
Reply | Threaded
Open this post in threaded view
|

GtkAda printing problem

bertus.dries
I have a problem with printing from Gtk.

The print is working correctly if I print a document which results in 19
pages. But with one page with 48 lines of text I just get an empty page and
I just don't get the print dialog. Herewith I give you the part of  the
program where it goes wrong.:

In the On_Print procedure:

      last_line := integer(nr) - 1;
      Print_Op := new Gtkada_Print_Operation_Record;
      Gtkada.Printing.Initialize (Print_Op);
      Gtk_New(Print_Set);
      Set_Current_Page (Print_Op, 1);
      Number := long_float(last_line) / long_float(delta_lines);
      Number := long_float'Rounding(Number + 0.4999999);
      nr_Pages := Gint(Number);
      Set_N_Pages (Print_Op, nr_Pages);
      Set_Use_Full_Page(Print_Op, true);
      Set_Unit (Print_Op, points);
      Print_Op.Set_Print_Settings(Print_Set);
--------------------------------------------------------------------
--   procedure On_Draw_Page
--      (Self  : not null access Gtk_Print_Operation_Record;
--       Call  : Cb_Gtk_Print_Operation_Gtk_Print_Context_Gint_Void;
--       After : Boolean := False);
--------------------------------------------------------------------
      On_Draw_Page(Print_Op, Draw);
      Result := Connect_and_Run(Print_Op ,Action_Print_Dialog, Main_Window);

Draw is declared as

Draw      : Cb_Gtk_Print_Operation_Gtk_Print_Context_Gint_Void
            := Draw_Page'Access;


and  the Draw_Page procedure

   procedure Draw_Page
     (Op          : access Gtk_Print_Operation_Record'Class;
      Context     : not null access Gtk_Print_Context_Record'Class;
      Page_Number : Gint) is
      Cr    : Cairo_Context;
      nr    : integer;
      width : integer;
      rb    : boolean;
--      re    : boolean;
      ok    : boolean;
      str   : Unbounded_String;
   begin
      nr := first_line;
      Cr := Get_Cairo_Context (Context);
      Set_Source_Rgb (Cr, 0.0, 0.0, 0.0);
      Select_font_face(Cr, "Monospace", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
      Set_Font_Size(Cr, GDouble(9));
      if nr = 1 then
         pagenr := 1;
      else
         pagenr := pagenr + 1;
      end if;
      if pagenr rem 2 = 1 then
         width := 70;
      else
         width := 40;
      end if;
      if last_page_line > last_line then
         last_page_line := last_line;
      end if;
      ok := false;
      while not ok loop
         Get_Iter_At_Line(Main_Window.Draw_Buffer, first, Gint(nr));
         Get_Iter_At_Line_Offset(Main_Window.Draw_Buffer, endln, Gint(nr), 500);
         move_to(cr, Gdouble(width), Gdouble((nr - first_line + 1) * 13 + 65));
         str :=
To_Unbounded_String(Get_Text(Main_Window.Draw_Buffer,first,endln));
         show_text(cr, To_String(str));
         nr := nr + 1;
         ok := nr >= last_page_line;
         if nr <= last_line then
            Forward_Line(first, rb);
         end if;
      end loop;
      first_line := nr - 1;
      last_page_line := last_page_line + delta_lines;
   end Draw_Page;

 

_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada
Reply | Threaded
Open this post in threaded view
|

Re: Compile GtkAda

Adam Puleo
In reply to this post by Adam Puleo
I did some more digging on this.

When gprbuild generates the gtkada.lexch file it’s adding two lines:
-Wl,-Wl,-framework
-Wl,-Wl,CoreFoundation

The repeated -Wl is causing the problems. If I edit gtkada.lexch file and remove one of the duplicate -Wl’s gprlib then runs successfully.

-Adam


On Nov 26, 2018, at 12:06 AM, Jan de Kruyf <[hidden email]> wrote:

Hi, I dont know MacOS but from what I see:
> ld: warning: directory not found for option '-L/Users/adampuleo/Documents/programs/gtkada//lib'
> ld: warning: directory not found for option '-L/Users/adampuleo/Documents/programs/gtkada//bin'
It is clear that ld has issues with finding 2 search paths.

perhaps there is a conflict between /users and /Users since it also says:
>gprlib: /users/adampuleo/opt/gnat/2018/bin/gcc execution error

The next error confuzzles me:
>ld: unknown option: -Wl

-Wl is the gcc switch to pass options to ld when gcc is used as the front end to ld, so ld should never see it. 
It is almost as if ld is run directly without going through gcc.

So considering all this I think that maybe your PATH is not set right.

Try "echo $PATH" in the terminal where you compile and see where it points.

j.


On Mon, Nov 26, 2018 at 6:24 AM Adam Puleo <[hidden email]> wrote:
Hello,

I’m trying to compile GtkAda on macOS using Gnat 2018.

Configure (CC=/usr/bin/gcc ./configure --prefix=/usr/local) completed successfully.

Make fails with the following messages:
   [Ada]          pango-layout.adb
   [Ada]          gtk-tearoff_menu_item.adb
   [Ada]          glib-string.adb
   [C]            misc.c
   [C]            misc_generated.c
Build Libraries
   [gprlib]       gtkada.lexch
   [archive]      libgtkada.a
   [index]        libgtkada.a
====== Building static-pic libraries =====
/Users/adampuleo/opt/GNAT/2018/bin/gprbuild  -j0 -m -p  -XLIBRARY_TYPE=static-pic -Psrc/gtkada.gpr
====== Building relocatable libraries =====
/Users/adampuleo/opt/GNAT/2018/bin/gprbuild  -j0 -m -p  -XLIBRARY_TYPE=relocatable -Psrc/gtkada.gpr
Build Libraries
   [gprlib]       gtkada.lexch
   [link library] libgtkada.dylib
ld: warning: directory not found for option '-L/Users/adampuleo/Documents/programs/gtkada//lib'
ld: warning: directory not found for option '-L/Users/adampuleo/Documents/programs/gtkada//bin'
ld: unknown option: -Wl
collect2: error: ld returned 1 exit status
gprlib: /users/adampuleo/opt/gnat/2018/bin/gcc execution error
gprbuild: could not build library for project gtkada
make: *** [Makefile:85: build_library_type/relocatable] Error 4

I’m unsure on how to proceed on troubleshooting this.

Any ideas?

Thanks,
-Adam

_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada


_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada
Reply | Threaded
Open this post in threaded view
|

Re: Compile GtkAda

Pascal-68

> Le 1 déc. 2018 à 20:33, Adam Puleo <[hidden email]> a écrit :
>
> I did some more digging on this.
>
> When gprbuild generates the gtkada.lexch file it’s adding two lines:
> -Wl,-Wl,-framework
> -Wl,-Wl,CoreFoundation
>
> The repeated -Wl is causing the problems. If I edit gtkada.lexch file and remove one of the duplicate -Wl’s gprlib then runs successfully.

Hello Adam,

Could you share your modifications?

I've done also some changes available on Github:
https://github.com/AdaCore/gtkada/compare/master...Blady-Com:xnadalib-2018

Is it similar to yours?
Did you activate OpenGL?

Here is an extract from my howto (in French):
http://blady.pagesperso-orange.fr/telechargements/gtkada/Install-GTKAda-Quartz_wf.pdf

$ PATH=/usr/local/gnat/bin:$PATH
$ instxada=/usr/local/xnadalib-2018
$ PATH=$instxada/bin:$PATH
$ cd /usr/local/src-2018
$ git clone https://github.com/Blady-Com/gtkada.git
$ cd gtkada
$ git checkout xnadalib-2018
$ CPPFLAGS=-I$instxada/include LDFLAGS=-L$instxada/lib ./configure --prefix=$instxada --enable-build=Debug --disable-shared
$ make
$ make install
$ cp -p po/build_skeleton.pl $instxada/bin

PS: you can download prebuilt GTKAda binaries on:
https://sourceforge.net/projects/gnuada/files/GNAT_GPL%20Mac%20OS%20X/2018-high-sierra/

HTH, Pascal.
http://blady.pagesperso-orange.fr


_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada
Reply | Threaded
Open this post in threaded view
|

Re: Compile GtkAda

Adam Puleo
Hello Pascal,

If I modify gtkada’s configure file according to the link you provided (https://github.com/AdaCore/gtkada/compare/master...Blady-Com:xnadalib-2018) the problem is fixed. Thank you.

What I did before was just hand edit gtkada.lexch and ran gprlib manually once and noticed that it was successful.

Configure did not find OpenGL so it was not activated.

To compile gtkada I executed the following commands:
$ cd gtkada
$ export PATH=/Users/adampuleo/opt/GNAT/2018/bin:/Users/adampuleo/gtk/inst/bin:$PATH
$ CC=/usr/bin/gcc ./configure --prefix=/usr/local
$ make
$ sudo make install

On Dec 2, 2018, at 3:39 AM, Pascal <[hidden email]> wrote:


Le 1 déc. 2018 à 20:33, Adam Puleo <[hidden email]> a écrit :

I did some more digging on this.

When gprbuild generates the gtkada.lexch file it’s adding two lines:
-Wl,-Wl,-framework
-Wl,-Wl,CoreFoundation

The repeated -Wl is causing the problems. If I edit gtkada.lexch file and remove one of the duplicate -Wl’s gprlib then runs successfully.

Hello Adam,

Could you share your modifications?

I've done also some changes available on Github:
https://github.com/AdaCore/gtkada/compare/master...Blady-Com:xnadalib-2018

Is it similar to yours?
Did you activate OpenGL?

Here is an extract from my howto (in French):
http://blady.pagesperso-orange.fr/telechargements/gtkada/Install-GTKAda-Quartz_wf.pdf

$ PATH=/usr/local/gnat/bin:$PATH
$ instxada=/usr/local/xnadalib-2018
$ PATH=$instxada/bin:$PATH
$ cd /usr/local/src-2018
$ git clone https://github.com/Blady-Com/gtkada.git
$ cd gtkada
$ git checkout xnadalib-2018
$ CPPFLAGS=-I$instxada/include LDFLAGS=-L$instxada/lib ./configure --prefix=$instxada --enable-build=Debug --disable-shared
$ make
$ make install
$ cp -p po/build_skeleton.pl $instxada/bin

PS: you can download prebuilt GTKAda binaries on:
https://sourceforge.net/projects/gnuada/files/GNAT_GPL%20Mac%20OS%20X/2018-high-sierra/

HTH, Pascal.
http://blady.pagesperso-orange.fr


_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada


_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada
Reply | Threaded
Open this post in threaded view
|

GtkAda TREE_VIEW column modify position after creation

Jose Alberto Fernandez Parejo
In reply to this post by bertus.dries
Hello,

I have a doubt regarding position of tree view column.

When I create the tree view column, I create in a defined order. For instance:

A B C D E

But I would like to modify after creation the order. ie:

B C E A D

I am looking for any procedure to do this in adacore but I don't find anything. Anyone can help me?

Thanks in advance.

Regards.



Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Si no es vd. el destinatario indicado, queda notificado que la lectura, utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.
Evite imprimir este mensaje si no es estrictamente necesario.

This email and any file attached to it (when applicable) contain(s) confidential information that is exclusively addressed to its recipient(s). If you are not the indicated recipient, you are informed that reading, using, disseminating and/or copying it without authorisation is forbidden in accordance with the legislation in effect. If you have received this email by mistake, please immediately notify the sender of the situation by resending it to their email address.
Avoid printing this message if it is not absolutely necessary.

_______________________________________________
gtkada mailing list
[hidden email]
https://lists.adacore.com/mailman/listinfo/gtkada