gtk +xml tutorial why not work?

New to FreeBASIC? Post your questions here.
covid19
Posts: 31
Joined: Apr 25, 2020 20:41

gtk +xml tutorial why not work?

Postby covid19 » Apr 30, 2020 21:44

hi guys i try torun this tutorial i saw here
https://www.freebasic-portal.de/code-be ... Tv22a8bnhA
this is a code

Code: Select all

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< main program generated by utility                 GTK+tobac2 V2.2.0 >
'< Hauptprogramm erzeugt von                                           >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' ---------------------------------------------------------------------
'< Program info:                                                       >
CONST PROG_NAME = "Scribble" '                                         >
CONST PROG_DESC = "Zeichenprogramm" '                                  >
CONST PROG_VERS = "0.0" '                                              >
CONST PROG_YEAR = "2010" '                                             >
CONST PROG_AUTH = "TJF" '                                              >
CONST PROG_MAIL = "Thomas.Freiherr@gmx.net" '                          >
CONST PROG_WEBS = "members.aon.at/tjf" '                               >
'<                                                                     >
'< Description / Beschreibung:                                         >
'< Beispiel DrawArea, einfaches Zeichenprogramm                        >
'<                                                                     >
'< License / Lizenz:                                                   >
'<                                                                     >
'< Redistribution and use in source and binary forms, with or          >
'< without modification, are permitted provided that the following     >
'< conditions are met:                                                 >
'<                                                                     >
'< * Redistributions of source code must retain the above              >
'< copyright notice, this list of conditions and the following         >
'< disclaimer.                                                         >
'<                                                                     >
'< * Redistributions in binary form must reproduce the above           >
'< copyright notice, this list of conditions and the following         >
'< disclaimer in the documentation and/or other materials provided     >
'< with the distribution.                                              >
'<                                                                     >
'< * Neither the name of the author nor the names of its               >
'< contributors may be used to endorse or promote products derived     >
'< from this software without specific prior written permission.       >
'<                                                                     >
'< THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS                  >
'< AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED                 >
'< WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES   >
'< OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE             >
'< ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER               >
'< OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,     >
'< SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT    >
'< LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF    >
'< USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED     >
'< AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT         >
'< LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN   >
'< ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE     >
'< POSSIBILITY OF SUCH DAMAGE.                                         >
'<                                                                     >
' ---------------------------------------------------------------------
'< Please prefer GNU GENERAL PUBLIC LICENSE to support open software.  >
'< For more information please visit:               http://www.fsf.org >
'<                                                                     >
'< Bitte bevorzugen Sie die GNU GENERAL PUBLIC LICENSE und             >
'< unterstuetzen Sie mit Ihrem Programm die freie Software             >
'< Mehr Informationen finden Sie unter:             http://www.fsf.org >
' ---------------------------------------------------------------------
'<  GTK+tobac:             general init / Allgemeine Initialisierungen >
  '  #INCLUDE "gtk/GTK-2.18.6_TJF.bi" '   GTK+library / GTK+ Bibliothek >
  #include once "gtk/gtk.bi"
    gtk_init(@__FB_ARGC__, @__FB_ARGV__) '     start GKT / GTK starten >
'<  GTK+tobac:                                   end block / Blockende >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

/' Backing pixmap for drawing area '/
DIM SHARED AS GdkPixmap PTR PIXMAP = NULL
DECLARE SUB draw_brush(BYVAL widget AS GtkWidget PTR, _
                       BYVAL x AS gdouble, _
                       BYVAL y AS gdouble)

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< _tobac.bas modul generated by utility             GTK+tobac2 V2.2.0 >
'< Modul _tobac.bas erzeugt von                                        >
'< Generated at / Generierung am                     2010-09-06, 02:45 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

IF gtk_check_version(2, 16, 0) THEN
  ?"Fehler/Error (GTK-Version): Version zu alt"
  END -1
END IF

DIM AS STRING GUISTR
DIM SHARED AS GtkBuilder PTR XML
DIM SHARED AS GObject PTR _
  WinScribble, Draw1, ButQuit

XML = gtk_builder_new()

SCOPE
  DIM AS GError PTR meld

  ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  '< _gui.bas modul generated by utility               GTK+tobac2 V2.2.0 >
  '< Modul _gui.bas erzeugt von                                          >
  '< Generated at / Generierung am                     2010-09-06, 02:45 >
  ' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

  GUIstr =_
  "<?xml version=""1.0""?>"+_
  "<interface>"+_
  "<requires lib=""gtk+"" version=""2.16""/>"+_
  "<!-- interface-naming-policy project-wide -->"+_
  "<object class=""GtkWindow"" id=""WinScribble"">"+_
  "<signal name=""destroy"" handler=""gtk_main_quit""/>"+_
  "<child>"+_
  "<object class=""GtkVBox"" id=""vbox1"">"+_
  "<property name=""visible"">True</property>"+_
  "<child>"+_
  "<object class=""GtkDrawingArea"" id=""Draw1"">"+_
  "<property name=""width_request"">200</property>"+_
  "<property name=""height_request"">200</property>"+_
  "<property name=""visible"">True</property>"+_
  "<property name=""events"">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_STRUCTURE_MASK</property>"+_
  "<signal name=""button_press_event"" handler=""on_Draw1_button_press_event""/>"+_
  "<signal name=""motion_notify_event"" handler=""on_Draw1_motion_notify_event""/>"+_
  "<signal name=""expose_event"" handler=""on_Draw1_expose_event""/>"+_
  "<signal name=""configure_event"" handler=""on_Draw1_configure_event""/>"+_
  "</object>"+_
  "<packing>"+_
  "<property name=""position"">0</property>"+_
  "</packing>"+_
  "</child>"+_
  "<child>"+_
  "<object class=""GtkButton"" id=""ButQuit"">"+_
  "<property name=""label"" translatable=""yes"">Quit</property>"+_
  "<property name=""visible"">True</property>"+_
  "<property name=""can_focus"">True</property>"+_
  "<property name=""receives_default"">True</property>"+_
  "<signal name=""clicked"" handler=""gtk_main_quit""/>"+_
  "</object>"+_
  "<packing>"+_
  "<property name=""expand"">False</property>"+_
  "<property name=""fill"">False</property>"+_
  "<property name=""position"">1</property>"+_
  "</packing>"+_
  "</child>"+_
  "</object>"+_
  "</child>"+_
  "</object>"+_
  "</interface>"
  IF 0 = gtk_builder_add_from_string(XML, SADD(GUISTR), LEN(GUISTR), @meld) THEN
    WITH *meld
      ?"Fehler/Error (GTK-Builder):"
      ?*.message
    END WITH
    END -1
  END IF
END SCOPE

WinScribble = gtk_builder_get_object(XML, "WinScribble")
Draw1 = gtk_builder_get_object(XML, "Draw1")
ButQuit = gtk_builder_get_object(XML, "ButQuit")

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_button_press_event CDECL ALIAS "on_Draw1_button_press_event" _
         (BYVAL widget AS GtkWidget PTR, _
          BYVAL event AS GdkEventButton PTR) AS gboolean EXPORT
  IF event->button = 1 THEN IF PIXMAP THEN draw_brush(widget, event->x, event->y)
  RETURN TRUE
END FUNCTION

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_motion_notify_event CDECL ALIAS "on_Draw1_motion_notify_event" _
         (BYVAL widget AS GtkWidget PTR, _
          BYVAL event AS GdkEventMotion PTR) AS gboolean EXPORT
  DIM AS INTEGER x, y
  DIM AS GdkModifierType state

  IF event->is_hint THEN
    gdk_window_get_pointer(event->window, @x, @y, @state)
  ELSE
    x = event->x
    y = event->y
    state = event->state
  END IF

  IF state AND GDK_BUTTON1_MASK THEN IF PIXMAP THEN draw_brush(widget, x, y)
  RETURN TRUE
END FUNCTION

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_expose_event CDECL ALIAS "on_Draw1_expose_event" _
         (BYVAL widget AS GtkWidget PTR, _
          BYVAL event AS GdkEventExpose PTR) AS gboolean EXPORT
  gdk_draw_drawable(widget->window, _
                    widget->style->fg_gc(gtk_widget_get_state(widget)), _
                    PIXMAP, _
                    event->area.x, event->area.y, _
                    event->area.x, event->area.y, _
                    event->area.width, event->area.height)
  RETURN FALSE
END FUNCTION

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_configure_event CDECL ALIAS "on_Draw1_configure_event" _
        (BYVAL widget AS GtkWidget PTR, _
         BYVAL event AS GdkEventConfigure PTR) AS gboolean EXPORT
  IF PIXMAP THEN g_object_unref(pixmap)

  PIXMAP = gdk_pixmap_new(widget->window, _
                          widget->allocation.width, _
                          widget->allocation.height, _
                          -1)
  gdk_draw_rectangle(PIXMAP, _
                     widget->style->white_gc, _
                     TRUE, _
                     0, 0, _
                     widget->allocation.width, _
                     widget->allocation.height)
  RETURN TRUE
END FUNCTION


SUB draw_brush(BYVAL widget AS GtkWidget PTR, _
               BYVAL x AS gdouble, _
               BYVAL y AS gdouble)
  DIM AS GdkRectangle update_rect

  update_rect.x = x - 5
  update_rect.y = y - 5
  update_rect.width = 10
  update_rect.height = 10
  gdk_draw_rectangle(PIXMAP, _
                     widget->style->black_gc, _
                     TRUE, _
                     update_rect.x, update_rect.y, _
                     update_rect.width, update_rect.height)
  gtk_widget_queue_draw_area(widget, _
                             update_rect.x, update_rect.y, _
                             update_rect.width, update_rect.height)
END SUB

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'<  GTK+tobac:   run GTK main, then end / GTK Hauptschleife, dann Ende >
    gtk_builder_connect_signals(XML, 0) '           callbacks anbinden >
    gtk_widget_show_all(GTK_WIDGET(WinScribble)) 'ptfenster darstellen >
    gtk_main() '                             main loop / Hauptschleife >
    g_object_unref(XML) '               dereference / Referenz abbauen >
'<  GTK+tobac:                                   end block / Blockende >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

' you may unref files here / ggf. Dateien hier schliessen

END 0 ' finish with return code 0 / Ende mit Returncode 0


return me

Code: Select all

Command executed:
"C:\FreeBasic\fbc.exe" "C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas"

Compiler output:
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(68) error 41: Variable not declared, NULL in 'DIM SHARED AS GdkPixmap PTR PIXMAP = NULL'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(68) warning 4(1): Suspicious pointer assignment
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(85) error 14: Expected identifier, found 'GtkBuilder' in 'DIM SHARED AS GtkBuilder PTR XML'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(89) error 41: Variable not declared, XML in 'XML = gtk_builder_new()'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(143) error 41: Variable not declared, gtk_builder_add_from_string in 'IF 0 = gtk_builder_add_from_string(XML, SADD(GUISTR), LEN(GUISTR), @meld) THEN'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(152) error 41: Variable not declared, gtk_builder_get_object in 'WinScribble = gtk_builder_get_object(XML, "WinScribble")'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(152) warning 4(1): Suspicious pointer assignment
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(153) error 67: Array not dimensioned, before '(' in 'Draw1 = gtk_builder_get_object(XML, "Draw1")'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(153) warning 4(1): Suspicious pointer assignment
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(154) error 67: Array not dimensioned, before '(' in 'ButQuit = gtk_builder_get_object(XML, "ButQuit")'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(154) warning 4(1): Suspicious pointer assignment
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(203) error 41: Variable not declared, gtk_widget_get_state in 'widget->style->fg_gc(gtk_widget_get_state(widget)), _'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(257) error 41: Variable not declared, gtk_builder_connect_signals in 'gtk_builder_connect_signals(XML, 0) '           callbacks anbinden >'
C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas(260) warning 1(1): Passing scalar as pointer, at parameter 1 of G_OBJECT_UNREF()

Results:
Compilation failed

System:
FBIde: 0.4.6
fbc:   FreeBASIC Compiler - Version 0.23.0 (08-14-2011) for win32 (target:win32)
OS:    Windows NT 6.2 (build 9200)

why this problem?
MrSwiss
Posts: 3581
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: gtk +xml tutorial why not work?

Postby MrSwiss » Apr 30, 2020 21:50

covid19 wrote:why this problem?
Well, you are using a very much outdated FBC version: 0.23.0.
Try a current version: 1.07.1 ...

Btw.: your link doesn't work (requirements e.t.c. at below link)
https://www.freebasic-portal.de/code-beispiele/gtk-wxwidgets-etc/scribble-gtk-gtkbuilder-176.html
covid19
Posts: 31
Joined: Apr 25, 2020 20:41

Re: gtk +xml tutorial why not work?

Postby covid19 » May 01, 2020 8:03

hi sorry i thinked if i download last version of FBide i will have also as last version of freebasic compiler , i try to run the script with winFBE but return me this error

Code: Select all

Compilazione fallita (Errori 1  Avvertenze 2  [2020-05-01  09:55:36])

Riga di comando:
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\fbc64.exe -m "C:\Users\pc\Desktop\test_freebasic\test2.a.bas" -v -s gui  -x "C:\Users\pc\Desktop\test_freebasic\test2.a.exe"

FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win64 (64bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
standalone
target:       win64, x86-64, 64bit
compiling:    C:\Users\pc\Desktop\test_freebasic\test2.a.bas -o C:\Users\pc\Desktop\test_freebasic\test2.a.c (main module)
C:\Users\pc\Desktop\test_freebasic\test2.a.bas(182) warning 3(1): Passing different pointer types, at parameter 2 of GDK_WINDOW_GET_POINTER()
C:\Users\pc\Desktop\test_freebasic\test2.a.bas(182) warning 3(1): Passing different pointer types, at parameter 3 of GDK_WINDOW_GET_POINTER()
compiling C:  C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\gcc.exe -m64 -march=x86-64 -S -nostdlib -nostdinc -Wall -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-main -Werror-implicit-function-declaration -O0 -fno-strict-aliasing -frounding-math -fno-math-errno -fwrapv -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-format -masm=intel "C:\Users\pc\Desktop\test_freebasic\test2.a.c" -o "C:\Users\pc\Desktop\test_freebasic\test2.a.asm"
assembling:   C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\as.exe --64 --strip-local-absolute "C:\Users\pc\Desktop\test_freebasic\test2.a.asm" -o "C:\Users\pc\Desktop\test_freebasic\test2.a.o"
linking:      C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe -m i386pep -o "C:\Users\pc\Desktop\test_freebasic\test2.a.exe" -subsystem windows "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\fbextra.x" --stack 1048576,1048576 -s -L "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64" -L "." "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\crt2.o" "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\crtbegin.o" "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\fbrt0.o" "C:\Users\pc\Desktop\test_freebasic\test2.a.o" "-(" -lgtk-win32-2.0 -lgdk-win32-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgthread-2.0 -lgmodule-2.0 -lcairo -lpango-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -latk-1.0 -lfb -lgcc -lmsvcrt -lkernel32 -luser32 -lmingw32 -lmingwex -lmoldname -lgcc_eh "-)" "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\crtend.o"
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgtk-win32-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgdk-win32-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgio-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgobject-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lglib-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgthread-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgmodule-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lcairo
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lpango-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgdk_pixbuf-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lpangocairo-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -latk-1.0
linking failed: 'C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe' terminated with exit code 1

i think a problem is a linker , but i dontknow how to resolve it i tested a script in win 64 gui , win32gui , console , but returnme always error ,
i try to inserto also in ambient option , compile configuration , options , -p c:\gtk\lib but nothing
covid19
Posts: 31
Joined: Apr 25, 2020 20:41

Re: gtk +xml tutorial why not work?

Postby covid19 » May 01, 2020 8:15

i copy in FBide the new version of freebasic , now return me this problem

Code: Select all

Command executed:
"C:\FreeBasic\fbc.exe" "C:\Users\pc\Desktop\test_freebasic\FBIDETEMP.bas"

Compiler output:
C:\FreeBasic\inc\gtk\glib\gmacros.bi(15) warning 39(0): Redefinition of intrinsic
C:\FreeBasic\inc\gtk\glib\gmacros.bi(16) warning 39(0): Redefinition of intrinsic
C:\FreeBasic\inc\gtk\glib\config.bi(23) error 4: Duplicated definition in 'type gint32 as integer'
C:\FreeBasic\inc\gtk\glib\config.bi(24) error 4: Duplicated definition in 'type guint32 as uinteger'
C:\FreeBasic\inc\gtk\glib\config.bi(29) error 4: Duplicated definition, G_HAVE_GINT64 in '#define G_HAVE_GINT64 1'
C:\FreeBasic\inc\gtk\glib\config.bi(37) error 4: Duplicated definition, GLIB_SIZEOF_VOID_P in '#define GLIB_SIZEOF_VOID_P 4'
C:\FreeBasic\inc\gtk\glib\config.bi(38) error 4: Duplicated definition, GLIB_SIZEOF_LONG in '#define GLIB_SIZEOF_LONG 4'
C:\FreeBasic\inc\gtk\glib\config.bi(41) error 4: Duplicated definition in 'type gssize as integer'
C:\FreeBasic\inc\gtk\glib\config.bi(42) error 4: Duplicated definition in 'type gsize as uinteger'
C:\FreeBasic\inc\gtk\glib\config.bi(47) error 4: Duplicated definition, GLIB_MAJOR_VERSION in '#define GLIB_MAJOR_VERSION 2'
C:\FreeBasic\inc\gtk\glib\config.bi(48) error 4: Duplicated definition, GLIB_MINOR_VERSION in '#define GLIB_MINOR_VERSION 6'
C:\FreeBasic\inc\gtk\glib\config.bi(49) error 4: Duplicated definition, GLIB_MICRO_VERSION in '#define GLIB_MICRO_VERSION 1'
C:\FreeBasic\inc\gtk\glib\config.bi(49) error 133: Too many errors, exiting

Results:
Compilation failed

System:
FBIde: 0.4.6
fbc:   FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit)
OS:    Windows NT 6.2 (build 9200)
Xusinboy Bekchanov
Posts: 246
Joined: Jul 26, 2018 18:28

Re: gtk +xml tutorial why not work?

Postby Xusinboy Bekchanov » May 01, 2020 8:23

covid19 wrote:hi sorry i thinked if i download last version of FBide i will have also as last version of freebasic compiler , i try to run the script with winFBE but return me this error

Code: Select all

C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgtk-win32-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgdk-win32-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgio-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgobject-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lglib-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgthread-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgmodule-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lcairo
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lpango-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgdk_pixbuf-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lpangocairo-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -latk-1.0
linking failed: 'C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe' terminated with exit code 1

i think a problem is a linker , but i dontknow how to resolve it i tested a script in win 64 gui , win32gui , console , but returnme always error ,
i try to inserto also in ambient option , compile configuration , options , -p c:\gtk\lib but nothing

You did not install the GTK library?
covid19
Posts: 31
Joined: Apr 25, 2020 20:41

Re: gtk +xml tutorial why not work?

Postby covid19 » May 01, 2020 10:33

yes i have in c:\GTK
MrSwiss
Posts: 3581
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: gtk +xml tutorial why not work?

Postby MrSwiss » May 01, 2020 14:53

covid19 wrote:yes i have in c:\GTK
You'll have to tell the linker, where to find it (not specific to GTK, for all lib's).
Put the following statement at the top of the nnnn.bas file (the main .bas file):

Code: Select all

#LibPath "C:\GTK"   ' modify as deemed necessary by your installation
covid19
Posts: 31
Joined: Apr 25, 2020 20:41

Re: gtk +xml tutorial why not work?

Postby covid19 » May 01, 2020 21:22

mmmmm
my code

Code: Select all

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< main program generated by utility                 GTK+tobac2 V2.2.0 >
'< Hauptprogramm erzeugt von                                           >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' ---------------------------------------------------------------------
'< Program info:                                                       >
CONST PROG_NAME = "Scribble" '                                         >
CONST PROG_DESC = "Zeichenprogramm" '                                  >
CONST PROG_VERS = "0.0" '                                              >
CONST PROG_YEAR = "2010" '                                             >
CONST PROG_AUTH = "TJF" '                                              >
CONST PROG_MAIL = "Thomas.Freiherr@gmx.net" '                          >
CONST PROG_WEBS = "members.aon.at/tjf" '                               >
'<                                                                     >
'< Description / Beschreibung:                                         >
'< Beispiel DrawArea, einfaches Zeichenprogramm                        >
'<                                                                     >
'< License / Lizenz:                                                   >
'<                                                                     >
'< Redistribution and use in source and binary forms, with or          >
'< without modification, are permitted provided that the following     >
'< conditions are met:                                                 >
'<                                                                     >
'< * Redistributions of source code must retain the above              >
'< copyright notice, this list of conditions and the following         >
'< disclaimer.                                                         >
'<                                                                     >
'< * Redistributions in binary form must reproduce the above           >
'< copyright notice, this list of conditions and the following         >
'< disclaimer in the documentation and/or other materials provided     >
'< with the distribution.                                              >
'<                                                                     >
'< * Neither the name of the author nor the names of its               >
'< contributors may be used to endorse or promote products derived     >
'< from this software without specific prior written permission.       >
'<                                                                     >
'< THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS                  >
'< AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED                 >
'< WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES   >
'< OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE             >
'< ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER               >
'< OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,     >
'< SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT    >
'< LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF    >
'< USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED     >
'< AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT         >
'< LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN   >
'< ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE     >
'< POSSIBILITY OF SUCH DAMAGE.                                         >
'<                                                                     >
' ---------------------------------------------------------------------
'< Please prefer GNU GENERAL PUBLIC LICENSE to support open software.  >
'< For more information please visit:               http://www.fsf.org >
'<                                                                     >
'< Bitte bevorzugen Sie die GNU GENERAL PUBLIC LICENSE und             >
'< unterstuetzen Sie mit Ihrem Programm die freie Software             >
'< Mehr Informationen finden Sie unter:             http://www.fsf.org >
' ---------------------------------------------------------------------
'<  GTK+tobac:             general init / Allgemeine Initialisierungen >
  '  #INCLUDE "gtk/GTK-2.18.6_TJF.bi" '   GTK+library / GTK+ Bibliothek >
#LibPath "C:\GTK"   ' modify as deemed necessary by your installation
  #include once "gtk/gtk.bi"
    gtk_init(@__FB_ARGC__, @__FB_ARGV__) '     start GKT / GTK starten >
'<  GTK+tobac:                                   end block / Blockende >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

/' Backing pixmap for drawing area '/
DIM SHARED AS GdkPixmap PTR PIXMAP = NULL
DECLARE SUB draw_brush(BYVAL widget AS GtkWidget PTR, _
                       BYVAL x AS gdouble, _
                       BYVAL y AS gdouble)

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< _tobac.bas modul generated by utility             GTK+tobac2 V2.2.0 >
'< Modul _tobac.bas erzeugt von                                        >
'< Generated at / Generierung am                     2010-09-06, 02:45 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

IF gtk_check_version(2, 16, 0) THEN
  ?"Fehler/Error (GTK-Version): Version zu alt"
  END -1
END IF

DIM AS STRING GUISTR
DIM SHARED AS GtkBuilder PTR XML
DIM SHARED AS GObject PTR _
  WinScribble, Draw1, ButQuit

XML = gtk_builder_new()

SCOPE
  DIM AS GError PTR meld

  ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  '< _gui.bas modul generated by utility               GTK+tobac2 V2.2.0 >
  '< Modul _gui.bas erzeugt von                                          >
  '< Generated at / Generierung am                     2010-09-06, 02:45 >
  ' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

  GUIstr =_
  "<?xml version=""1.0""?>"+_
  "<interface>"+_
  "<requires lib=""gtk+"" version=""2.16""/>"+_
  "<!-- interface-naming-policy project-wide -->"+_
  "<object class=""GtkWindow"" id=""WinScribble"">"+_
  "<signal name=""destroy"" handler=""gtk_main_quit""/>"+_
  "<child>"+_
  "<object class=""GtkVBox"" id=""vbox1"">"+_
  "<property name=""visible"">True</property>"+_
  "<child>"+_
  "<object class=""GtkDrawingArea"" id=""Draw1"">"+_
  "<property name=""width_request"">200</property>"+_
  "<property name=""height_request"">200</property>"+_
  "<property name=""visible"">True</property>"+_
  "<property name=""events"">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_STRUCTURE_MASK</property>"+_
  "<signal name=""button_press_event"" handler=""on_Draw1_button_press_event""/>"+_
  "<signal name=""motion_notify_event"" handler=""on_Draw1_motion_notify_event""/>"+_
  "<signal name=""expose_event"" handler=""on_Draw1_expose_event""/>"+_
  "<signal name=""configure_event"" handler=""on_Draw1_configure_event""/>"+_
  "</object>"+_
  "<packing>"+_
  "<property name=""position"">0</property>"+_
  "</packing>"+_
  "</child>"+_
  "<child>"+_
  "<object class=""GtkButton"" id=""ButQuit"">"+_
  "<property name=""label"" translatable=""yes"">Quit</property>"+_
  "<property name=""visible"">True</property>"+_
  "<property name=""can_focus"">True</property>"+_
  "<property name=""receives_default"">True</property>"+_
  "<signal name=""clicked"" handler=""gtk_main_quit""/>"+_
  "</object>"+_
  "<packing>"+_
  "<property name=""expand"">False</property>"+_
  "<property name=""fill"">False</property>"+_
  "<property name=""position"">1</property>"+_
  "</packing>"+_
  "</child>"+_
  "</object>"+_
  "</child>"+_
  "</object>"+_
  "</interface>"
  IF 0 = gtk_builder_add_from_string(XML, SADD(GUISTR), LEN(GUISTR), @meld) THEN
    WITH *meld
      ?"Fehler/Error (GTK-Builder):"
      ?*.message
    END WITH
    END -1
  END IF
END SCOPE

WinScribble = gtk_builder_get_object(XML, "WinScribble")
Draw1 = gtk_builder_get_object(XML, "Draw1")
ButQuit = gtk_builder_get_object(XML, "ButQuit")

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_button_press_event CDECL ALIAS "on_Draw1_button_press_event" _
         (BYVAL widget AS GtkWidget PTR, _
          BYVAL event AS GdkEventButton PTR) AS gboolean EXPORT
  IF event->button = 1 THEN IF PIXMAP THEN draw_brush(widget, event->x, event->y)
  RETURN TRUE
END FUNCTION

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_motion_notify_event CDECL ALIAS "on_Draw1_motion_notify_event" _
         (BYVAL widget AS GtkWidget PTR, _
          BYVAL event AS GdkEventMotion PTR) AS gboolean EXPORT
  DIM AS INTEGER x, y
  DIM AS GdkModifierType state

  IF event->is_hint THEN
    gdk_window_get_pointer(event->window, @x, @y, @state)
  ELSE
    x = event->x
    y = event->y
    state = event->state
  END IF

  IF state AND GDK_BUTTON1_MASK THEN IF PIXMAP THEN draw_brush(widget, x, y)
  RETURN TRUE
END FUNCTION

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_expose_event CDECL ALIAS "on_Draw1_expose_event" _
         (BYVAL widget AS GtkWidget PTR, _
          BYVAL event AS GdkEventExpose PTR) AS gboolean EXPORT
  gdk_draw_drawable(widget->window, _
                    widget->style->fg_gc(gtk_widget_get_state(widget)), _
                    PIXMAP, _
                    event->area.x, event->area.y, _
                    event->area.x, event->area.y, _
                    event->area.width, event->area.height)
  RETURN FALSE
END FUNCTION

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_configure_event CDECL ALIAS "on_Draw1_configure_event" _
        (BYVAL widget AS GtkWidget PTR, _
         BYVAL event AS GdkEventConfigure PTR) AS gboolean EXPORT
  IF PIXMAP THEN g_object_unref(pixmap)

  PIXMAP = gdk_pixmap_new(widget->window, _
                          widget->allocation.width, _
                          widget->allocation.height, _
                          -1)
  gdk_draw_rectangle(PIXMAP, _
                     widget->style->white_gc, _
                     TRUE, _
                     0, 0, _
                     widget->allocation.width, _
                     widget->allocation.height)
  RETURN TRUE
END FUNCTION


SUB draw_brush(BYVAL widget AS GtkWidget PTR, _
               BYVAL x AS gdouble, _
               BYVAL y AS gdouble)
  DIM AS GdkRectangle update_rect

  update_rect.x = x - 5
  update_rect.y = y - 5
  update_rect.width = 10
  update_rect.height = 10
  gdk_draw_rectangle(PIXMAP, _
                     widget->style->black_gc, _
                     TRUE, _
                     update_rect.x, update_rect.y, _
                     update_rect.width, update_rect.height)
  gtk_widget_queue_draw_area(widget, _
                             update_rect.x, update_rect.y, _
                             update_rect.width, update_rect.height)
END SUB

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'<  GTK+tobac:   run GTK main, then end / GTK Hauptschleife, dann Ende >
    gtk_builder_connect_signals(XML, 0) '           callbacks anbinden >
    gtk_widget_show_all(GTK_WIDGET(WinScribble)) 'ptfenster darstellen >
    gtk_main() '                             main loop / Hauptschleife >
    g_object_unref(XML) '               dereference / Referenz abbauen >
'<  GTK+tobac:                                   end block / Blockende >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

' you may unref files here / ggf. Dateien hier schliessen

END 0 ' finish with return code 0 / Ende mit Returncode 0


the error

Code: Select all

Compilazione fallita (Errori 1  Avvertenze 2  [2020-05-01  11:20:46])

Riga di comando:
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\fbc64.exe -m "C:\Users\pc\Desktop\test_freebasic\test2.a.bas" -v -s gui -p c:\gtk\lib -x "C:\Users\pc\Desktop\test_freebasic\test2.a.exe"

FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win64 (64bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
standalone
target:       win64, x86-64, 64bit
compiling:    C:\Users\pc\Desktop\test_freebasic\test2.a.bas -o C:\Users\pc\Desktop\test_freebasic\test2.a.c (main module)
C:\Users\pc\Desktop\test_freebasic\test2.a.bas(183) warning 3(1): Passing different pointer types, at parameter 2 of GDK_WINDOW_GET_POINTER()
C:\Users\pc\Desktop\test_freebasic\test2.a.bas(183) warning 3(1): Passing different pointer types, at parameter 3 of GDK_WINDOW_GET_POINTER()
compiling C:  C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\gcc.exe -m64 -march=x86-64 -S -nostdlib -nostdinc -Wall -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-main -Werror-implicit-function-declaration -O0 -fno-strict-aliasing -frounding-math -fno-math-errno -fwrapv -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-format -masm=intel "C:\Users\pc\Desktop\test_freebasic\test2.a.c" -o "C:\Users\pc\Desktop\test_freebasic\test2.a.asm"
assembling:   C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\as.exe --64 --strip-local-absolute "C:\Users\pc\Desktop\test_freebasic\test2.a.asm" -o "C:\Users\pc\Desktop\test_freebasic\test2.a.o"
linking:      C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe -m i386pep -o "C:\Users\pc\Desktop\test_freebasic\test2.a.exe" -subsystem windows "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\fbextra.x" --stack 1048576,1048576 -s -L "c:\gtk\lib" -L "C:\GTK" -L "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64" -L "." "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\crt2.o" "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\crtbegin.o" "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\fbrt0.o" "C:\Users\pc\Desktop\test_freebasic\test2.a.o" "-(" -lgtk-win32-2.0 -lgdk-win32-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgthread-2.0 -lgmodule-2.0 -lcairo -lpango-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -latk-1.0 -lfb -lgcc -lmsvcrt -lkernel32 -luser32 -lmingw32 -lmingwex -lmoldname -lgcc_eh "-)" "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\crtend.o"
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgtk-win32-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgdk-win32-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgio-2.0.dll.a when searching for -lgio-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgio-2.0.dll.a when searching for -lgio-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgio-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgobject-2.0.dll.a when searching for -lgobject-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgobject-2.0.dll.a when searching for -lgobject-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgobject-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libglib-2.0.dll.a when searching for -lglib-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libglib-2.0.dll.a when searching for -lglib-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lglib-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgthread-2.0.dll.a when searching for -lgthread-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgthread-2.0.dll.a when searching for -lgthread-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgthread-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgmodule-2.0.dll.a when searching for -lgmodule-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgmodule-2.0.dll.a when searching for -lgmodule-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgmodule-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libcairo.dll.a when searching for -lcairo
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libcairo.dll.a when searching for -lcairo
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lcairo
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libpango-1.0.dll.a when searching for -lpango-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libpango-1.0.dll.a when searching for -lpango-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lpango-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgdk_pixbuf-2.0.dll.a when searching for -lgdk_pixbuf-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgdk_pixbuf-2.0.dll.a when searching for -lgdk_pixbuf-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgdk_pixbuf-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libpangocairo-1.0.dll.a when searching for -lpangocairo-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libpangocairo-1.0.dll.a when searching for -lpangocairo-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lpangocairo-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libatk-1.0.dll.a when searching for -latk-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libatk-1.0.dll.a when searching for -latk-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -latk-1.0
linking failed: 'C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe' terminated with exit code 1
MrSwiss
Posts: 3581
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: gtk +xml tutorial why not work?

Postby MrSwiss » May 01, 2020 21:52

Looks like the GTK libraries are 32 bit, and you're using FBC x64.
The libraries must always have the same bitness as the compiler used.
skipping incompatible c:\gtk\lib/libglib-2.0.dll.a
"incompatible" indicates "wrong bitness" ...

Install the 64 bit GTK libraries or use FBC x32 for the next test.
(Btw.: I don't understand, why beginners always go "into the deep end", to make a start.)
covid19
Posts: 31
Joined: Apr 25, 2020 20:41

Re: gtk +xml tutorial why not work?

Postby covid19 » May 02, 2020 9:21

i download a gtk+ 64 ftp://ftp.gnome.org/pub/gnome/binaries/ ... _win64.zip
and i have created a c:\GTK64 , i linked in the sourced

Code: Select all

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< main program generated by utility                 GTK+tobac2 V2.2.0 >
'< Hauptprogramm erzeugt von                                           >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' ---------------------------------------------------------------------
'< Program info:                                                       >
CONST PROG_NAME = "Scribble" '                                         >
CONST PROG_DESC = "Zeichenprogramm" '                                  >
CONST PROG_VERS = "0.0" '                                              >
CONST PROG_YEAR = "2010" '                                             >
CONST PROG_AUTH = "TJF" '                                              >
CONST PROG_MAIL = "Thomas.Freiherr@gmx.net" '                          >
CONST PROG_WEBS = "members.aon.at/tjf" '                               >
'<                                                                     >
'< Description / Beschreibung:                                         >
'< Beispiel DrawArea, einfaches Zeichenprogramm                        >
'<                                                                     >
'< License / Lizenz:                                                   >
'<                                                                     >
'< Redistribution and use in source and binary forms, with or          >
'< without modification, are permitted provided that the following     >
'< conditions are met:                                                 >
'<                                                                     >
'< * Redistributions of source code must retain the above              >
'< copyright notice, this list of conditions and the following         >
'< disclaimer.                                                         >
'<                                                                     >
'< * Redistributions in binary form must reproduce the above           >
'< copyright notice, this list of conditions and the following         >
'< disclaimer in the documentation and/or other materials provided     >
'< with the distribution.                                              >
'<                                                                     >
'< * Neither the name of the author nor the names of its               >
'< contributors may be used to endorse or promote products derived     >
'< from this software without specific prior written permission.       >
'<                                                                     >
'< THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS                  >
'< AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED                 >
'< WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES   >
'< OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE             >
'< ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER               >
'< OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,     >
'< SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT    >
'< LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF    >
'< USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED     >
'< AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT         >
'< LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN   >
'< ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE     >
'< POSSIBILITY OF SUCH DAMAGE.                                         >
'<                                                                     >
' ---------------------------------------------------------------------
'< Please prefer GNU GENERAL PUBLIC LICENSE to support open software.  >
'< For more information please visit:               http://www.fsf.org >
'<                                                                     >
'< Bitte bevorzugen Sie die GNU GENERAL PUBLIC LICENSE und             >
'< unterstuetzen Sie mit Ihrem Programm die freie Software             >
'< Mehr Informationen finden Sie unter:             http://www.fsf.org >
' ---------------------------------------------------------------------
'<  GTK+tobac:             general init / Allgemeine Initialisierungen >
  '  #INCLUDE "gtk/GTK-2.18.6_TJF.bi" '   GTK+library / GTK+ Bibliothek >
#LibPath "C:\GTK64"   ' modify as deemed necessary by your installation
  #include once "gtk/gtk.bi"
    gtk_init(@__FB_ARGC__, @__FB_ARGV__) '     start GKT / GTK starten >
'<  GTK+tobac:                                   end block / Blockende >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

/' Backing pixmap for drawing area '/
DIM SHARED AS GdkPixmap PTR PIXMAP = NULL
DECLARE SUB draw_brush(BYVAL widget AS GtkWidget PTR, _
                       BYVAL x AS gdouble, _
                       BYVAL y AS gdouble)

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< _tobac.bas modul generated by utility             GTK+tobac2 V2.2.0 >
'< Modul _tobac.bas erzeugt von                                        >
'< Generated at / Generierung am                     2010-09-06, 02:45 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

IF gtk_check_version(2, 16, 0) THEN
  ?"Fehler/Error (GTK-Version): Version zu alt"
  END -1
END IF

DIM AS STRING GUISTR
DIM SHARED AS GtkBuilder PTR XML
DIM SHARED AS GObject PTR _
  WinScribble, Draw1, ButQuit

XML = gtk_builder_new()

SCOPE
  DIM AS GError PTR meld

  ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  '< _gui.bas modul generated by utility               GTK+tobac2 V2.2.0 >
  '< Modul _gui.bas erzeugt von                                          >
  '< Generated at / Generierung am                     2010-09-06, 02:45 >
  ' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

  GUIstr =_
  "<?xml version=""1.0""?>"+_
  "<interface>"+_
  "<requires lib=""gtk+"" version=""2.16""/>"+_
  "<!-- interface-naming-policy project-wide -->"+_
  "<object class=""GtkWindow"" id=""WinScribble"">"+_
  "<signal name=""destroy"" handler=""gtk_main_quit""/>"+_
  "<child>"+_
  "<object class=""GtkVBox"" id=""vbox1"">"+_
  "<property name=""visible"">True</property>"+_
  "<child>"+_
  "<object class=""GtkDrawingArea"" id=""Draw1"">"+_
  "<property name=""width_request"">200</property>"+_
  "<property name=""height_request"">200</property>"+_
  "<property name=""visible"">True</property>"+_
  "<property name=""events"">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_STRUCTURE_MASK</property>"+_
  "<signal name=""button_press_event"" handler=""on_Draw1_button_press_event""/>"+_
  "<signal name=""motion_notify_event"" handler=""on_Draw1_motion_notify_event""/>"+_
  "<signal name=""expose_event"" handler=""on_Draw1_expose_event""/>"+_
  "<signal name=""configure_event"" handler=""on_Draw1_configure_event""/>"+_
  "</object>"+_
  "<packing>"+_
  "<property name=""position"">0</property>"+_
  "</packing>"+_
  "</child>"+_
  "<child>"+_
  "<object class=""GtkButton"" id=""ButQuit"">"+_
  "<property name=""label"" translatable=""yes"">Quit</property>"+_
  "<property name=""visible"">True</property>"+_
  "<property name=""can_focus"">True</property>"+_
  "<property name=""receives_default"">True</property>"+_
  "<signal name=""clicked"" handler=""gtk_main_quit""/>"+_
  "</object>"+_
  "<packing>"+_
  "<property name=""expand"">False</property>"+_
  "<property name=""fill"">False</property>"+_
  "<property name=""position"">1</property>"+_
  "</packing>"+_
  "</child>"+_
  "</object>"+_
  "</child>"+_
  "</object>"+_
  "</interface>"
  IF 0 = gtk_builder_add_from_string(XML, SADD(GUISTR), LEN(GUISTR), @meld) THEN
    WITH *meld
      ?"Fehler/Error (GTK-Builder):"
      ?*.message
    END WITH
    END -1
  END IF
END SCOPE

WinScribble = gtk_builder_get_object(XML, "WinScribble")
Draw1 = gtk_builder_get_object(XML, "Draw1")
ButQuit = gtk_builder_get_object(XML, "ButQuit")

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_button_press_event CDECL ALIAS "on_Draw1_button_press_event" _
         (BYVAL widget AS GtkWidget PTR, _
          BYVAL event AS GdkEventButton PTR) AS gboolean EXPORT
  IF event->button = 1 THEN IF PIXMAP THEN draw_brush(widget, event->x, event->y)
  RETURN TRUE
END FUNCTION

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_motion_notify_event CDECL ALIAS "on_Draw1_motion_notify_event" _
         (BYVAL widget AS GtkWidget PTR, _
          BYVAL event AS GdkEventMotion PTR) AS gboolean EXPORT
  DIM AS INTEGER x, y
  DIM AS GdkModifierType state

  IF event->is_hint THEN
    gdk_window_get_pointer(event->window, @x, @y, @state)
  ELSE
    x = event->x
    y = event->y
    state = event->state
  END IF

  IF state AND GDK_BUTTON1_MASK THEN IF PIXMAP THEN draw_brush(widget, x, y)
  RETURN TRUE
END FUNCTION

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_expose_event CDECL ALIAS "on_Draw1_expose_event" _
         (BYVAL widget AS GtkWidget PTR, _
          BYVAL event AS GdkEventExpose PTR) AS gboolean EXPORT
  gdk_draw_drawable(widget->window, _
                    widget->style->fg_gc(gtk_widget_get_state(widget)), _
                    PIXMAP, _
                    event->area.x, event->area.y, _
                    event->area.x, event->area.y, _
                    event->area.width, event->area.height)
  RETURN FALSE
END FUNCTION

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'< callback modul generated by utility               GTK+tobac2 V2.2.0 >
'< callback-Modul erzeugt von                                          >
'< Generated at / Generierung am                     2010-09-06, 01:24 >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

FUNCTION on_Draw1_configure_event CDECL ALIAS "on_Draw1_configure_event" _
        (BYVAL widget AS GtkWidget PTR, _
         BYVAL event AS GdkEventConfigure PTR) AS gboolean EXPORT
  IF PIXMAP THEN g_object_unref(pixmap)

  PIXMAP = gdk_pixmap_new(widget->window, _
                          widget->allocation.width, _
                          widget->allocation.height, _
                          -1)
  gdk_draw_rectangle(PIXMAP, _
                     widget->style->white_gc, _
                     TRUE, _
                     0, 0, _
                     widget->allocation.width, _
                     widget->allocation.height)
  RETURN TRUE
END FUNCTION


SUB draw_brush(BYVAL widget AS GtkWidget PTR, _
               BYVAL x AS gdouble, _
               BYVAL y AS gdouble)
  DIM AS GdkRectangle update_rect

  update_rect.x = x - 5
  update_rect.y = y - 5
  update_rect.width = 10
  update_rect.height = 10
  gdk_draw_rectangle(PIXMAP, _
                     widget->style->black_gc, _
                     TRUE, _
                     update_rect.x, update_rect.y, _
                     update_rect.width, update_rect.height)
  gtk_widget_queue_draw_area(widget, _
                             update_rect.x, update_rect.y, _
                             update_rect.width, update_rect.height)
END SUB

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'<  GTK+tobac:   run GTK main, then end / GTK Hauptschleife, dann Ende >
    gtk_builder_connect_signals(XML, 0) '           callbacks anbinden >
    gtk_widget_show_all(GTK_WIDGET(WinScribble)) 'ptfenster darstellen >
    gtk_main() '                             main loop / Hauptschleife >
    g_object_unref(XML) '               dereference / Referenz abbauen >
'<  GTK+tobac:                                   end block / Blockende >
' vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

' you may unref files here / ggf. Dateien hier schliessen

END 0 ' finish with return code 0 / Ende mit Returncode 0


but not work , now return me

Code: Select all

Compilazione fallita (Errori 1  Avvertenze 2  [2020-05-02  11:10:46])

Riga di comando:
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\fbc64.exe -m "C:\Users\pc\Desktop\test_freebasic\test2.a.bas" -v -s console -p c:\gtk\lib -x "C:\Users\pc\Desktop\test_freebasic\test2.a.exe"

FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win64 (64bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
standalone
target:       win64, x86-64, 64bit
compiling:    C:\Users\pc\Desktop\test_freebasic\test2.a.bas -o C:\Users\pc\Desktop\test_freebasic\test2.a.c (main module)
C:\Users\pc\Desktop\test_freebasic\test2.a.bas(183) warning 3(1): Passing different pointer types, at parameter 2 of GDK_WINDOW_GET_POINTER()
C:\Users\pc\Desktop\test_freebasic\test2.a.bas(183) warning 3(1): Passing different pointer types, at parameter 3 of GDK_WINDOW_GET_POINTER()
compiling C:  C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\gcc.exe -m64 -march=x86-64 -S -nostdlib -nostdinc -Wall -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-main -Werror-implicit-function-declaration -O0 -fno-strict-aliasing -frounding-math -fno-math-errno -fwrapv -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-format -masm=intel "C:\Users\pc\Desktop\test_freebasic\test2.a.c" -o "C:\Users\pc\Desktop\test_freebasic\test2.a.asm"
assembling:   C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\as.exe --64 --strip-local-absolute "C:\Users\pc\Desktop\test_freebasic\test2.a.asm" -o "C:\Users\pc\Desktop\test_freebasic\test2.a.o"
linking:      C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe -m i386pep -o "C:\Users\pc\Desktop\test_freebasic\test2.a.exe" -subsystem console "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\fbextra.x" --stack 1048576,1048576 -s -L "c:\gtk\lib" -L "C:\GTK64" -L "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64" -L "." "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\crt2.o" "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\crtbegin.o" "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\fbrt0.o" "C:\Users\pc\Desktop\test_freebasic\test2.a.o" "-(" -lgtk-win32-2.0 -lgdk-win32-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgthread-2.0 -lgmodule-2.0 -lcairo -lpango-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -latk-1.0 -lfb -lgcc -lmsvcrt -lkernel32 -luser32 -lmingw32 -lmingwex -lmoldname -lgcc_eh "-)" "C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win64\crtend.o"
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgtk-win32-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgdk-win32-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgio-2.0.dll.a when searching for -lgio-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgio-2.0.dll.a when searching for -lgio-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgio-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgobject-2.0.dll.a when searching for -lgobject-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgobject-2.0.dll.a when searching for -lgobject-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgobject-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libglib-2.0.dll.a when searching for -lglib-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libglib-2.0.dll.a when searching for -lglib-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lglib-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgthread-2.0.dll.a when searching for -lgthread-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgthread-2.0.dll.a when searching for -lgthread-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgthread-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgmodule-2.0.dll.a when searching for -lgmodule-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgmodule-2.0.dll.a when searching for -lgmodule-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgmodule-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libcairo.dll.a when searching for -lcairo
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libcairo.dll.a when searching for -lcairo
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lcairo
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libpango-1.0.dll.a when searching for -lpango-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libpango-1.0.dll.a when searching for -lpango-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lpango-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgdk_pixbuf-2.0.dll.a when searching for -lgdk_pixbuf-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libgdk_pixbuf-2.0.dll.a when searching for -lgdk_pixbuf-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lgdk_pixbuf-2.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libpangocairo-1.0.dll.a when searching for -lpangocairo-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libpangocairo-1.0.dll.a when searching for -lpangocairo-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -lpangocairo-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libatk-1.0.dll.a when searching for -latk-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: skipping incompatible c:\gtk\lib/libatk-1.0.dll.a when searching for -latk-1.0
C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe: cannot find -latk-1.0
linking failed: 'C:\Users\pc\Downloads\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win64\ld.exe' terminated with exit code 1

(Btw.: I don't understand, why beginners always go "into the deep end", to make a start.)

I think you should ask .....why insert example , not worked ?

P.S.it would be nice to have a visual studio style package, with everything already in and ready, especially for beginners, the first approach is not absolutely friendly, but rather tends to move away, luckily you are on the forum
MrSwiss
Posts: 3581
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: gtk +xml tutorial why not work?

Postby MrSwiss » May 03, 2020 16:50

covid19 wrote:
MrSwiss wrote:(Btw.: I don't understand, why beginners always go "into the deep end", to make a start.)

I think you should ask .....why insert example , not worked ?
No, that's not the mayor problem.

Since, you don't seem to understand, that I'm referring to 'external libraries'.
Have a look at an old post of mine, regarding beginners & external libraries:
Problem trying to use extended library
(same problem, just another external library)
systemctl
Posts: 182
Joined: Mar 27, 2020 5:15

Re: gtk +xml tutorial why not work?

Postby systemctl » May 03, 2020 19:35

Anyway, I think no one do GTK+ development on Windows because it's cubersome. The homeland of GTK+ is Linux and other Unix-like systems. Might you switch to IUP? IUP is more easier to setup and coding in.
systemctl
Posts: 182
Joined: Mar 27, 2020 5:15

Re: gtk +xml tutorial why not work?

Postby systemctl » May 03, 2020 19:38

MrSwiss wrote:(Btw.: I don't understand, why beginners always go "into the deep end", to make a start.)


Because they want to have something (product) to convince themselves that it's worth. I'm a beginner too and FreeBASIC is not the only thing on my bucket of programming languages. But I don't have to ability to learn all of them so I want to make some small product which FreeBASIC to convince myself that FreeBASIC is the right tool and is enough so just stop there. This is the reason why I jump immediately to translating C headers into FreeBASIC. I only want to make something that works but not yet successful.
covid19
Posts: 31
Joined: Apr 25, 2020 20:41

Re: gtk +xml tutorial why not work?

Postby covid19 » May 09, 2020 12:08

Since, you don't seem to understand, that I'm referring to 'external libraries'.
Have a look at an old post of mine, regarding beginners & external libraries:
Problem trying to use extended library
(same problem, just another external library)

i read a post , in practical you tell me..... , the example work only if you know how to use external library ,(it is inferred example is not worked , because you must "Debug " before run o_O )
is like if i give example with out variable , you must know for do 1+1 =2 , but 1 you must insert in variable if you dont know this you can see example o_O .
i think if you give a example you must give faculty also all people look example , but this is my opinion , not give half example and without instruction for see it . but reapeat is only my opinion

Anyway, I think no one do GTK+ development on Windows because it's cubersome. The homeland of GTK+ is Linux and other Unix-like systems. Might you switch to IUP? IUP is more easier to setup and coding in.

i would create a crossplatform app iup work in linux ?? ....
badidea
Posts: 2126
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: gtk +xml tutorial why not work?

Postby badidea » May 09, 2020 12:10

covid19 wrote:i would create a crossplatform app iup work in linux ?? ....

See: Re: IUP GUI lib (Win/Lin) getting started

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 3 guests