flat assembler
Message board for the users of flat assembler.
Index
> Linux > GTK examples in FASM obsolete? |
Author |
|
ProphetOfDoom 08 Dec 2010, 21:35
Hi,
I assume you're using the gtk-button example. I got it working by doing the following. 1) Install libgtk2.0-dev (at least that's what it's called on Ubuntu) 2) Install the program pkg-config if you haven't already got it. 3) Change the second line of "makefile" to read: Code: gcc -Wall -s -O3 button.o -o button `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0` 4) open "button.asm" and change this: Code: extrn gtk_signal_connect to this: Code: extrn g_signal_connect_data Now change the two calls to gtk_signal_connect so they read: Code: ccall g_signal_connect_data, [hWindow], szDeleteEvent, DeleteEvent, dword 0, dword 0 ccall g_signal_connect_data, [hButton], szClicked, ButtonClick, dword 0, dword 0 |
|||
08 Dec 2010, 21:35 |
|
keantoken 08 Dec 2010, 22:58
Thanks!
- keantoken |
|||
08 Dec 2010, 22:58 |
|
bazik 12 Dec 2010, 23:17
I should really update those examples to GTK2+
|
|||
12 Dec 2010, 23:17 |
|
Tomasz Grysztar 13 Dec 2010, 00:50
bazik! It is so amazing to see you here again. How are you?
|
|||
13 Dec 2010, 00:50 |
|
bazik 13 Dec 2010, 12:19
I'm fine, I posted a thread in the Heap, about emerging back from exile
|
|||
13 Dec 2010, 12:19 |
|
catafest 15 Sep 2020, 19:54
I don't know why it doesn't work in Fedora 32, any ideas?
Code: [mythcat@desk fasm]$ ./fasm.x64 button.asm button.o ... [mythcat@desk fasm]$ ./fasm button.asm button.o ... [mythcat@desk fasm]$ gcc button.o $(pkg-config --cflags --libs gtk+-3.0) -o button /bin/ld: i386 architecture of input file `button.o' is incompatible with i386:x86-64 output collect2: error: ld returned 1 exit status [mythcat@desk fasm]$ gcc --version gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1) Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [mythcat@desk fasm]$ file button.o button.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped [mythcat@desk fasm]$ pkg-config --cflags gtk+-3.0 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr /include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr /include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr /include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread [mythcat@desk fasm]$ ls /usr/include/gtk* gdk gtk unix-print [mythcat@desk fasm]$ file /bin/gcc /bin/gcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=... , for GNU/Linux 3.2.0, stripped |
|||
15 Sep 2020, 19:54 |
|
revolution 15 Sep 2020, 22:27
I suspect you need to tell GCC to output a 32-bit file. Or you might need to link it to a 32-bit library. Or both.
|
|||
15 Sep 2020, 22:27 |
|
Furs 16 Sep 2020, 17:35
Use -m32 when invoking gcc.
|
|||
16 Sep 2020, 17:35 |
|
catafest 05 Oct 2020, 20:14
The c source code with GTK simple button works ... and the run of the result ...
Code: [mythcat@desk fasm]$ gcc -Wall -g `pkg-config --cflags gtk+-3.0` test.c -o test `pkg-config --libs gtk+-3.0` Why not this ? Code: [mythcat@desk fasm]$ gcc -Wall -g `pkg-config --cflags gtk+-2.0` button.o -m32 -o button `pkg-config --libs gtk+-2.0` /bin/ld: cannot find -lpangocairo-1.0 /bin/ld: cannot find -latk-1.0 /bin/ld: cannot find -lcairo /bin/ld: cannot find -lpangoft2-1.0 /bin/ld: cannot find -lpango-1.0 /bin/ld: cannot find -lharfbuzz /bin/ld: cannot find -lfontconfig /bin/ld: cannot find -lfreetype collect2: error: ld returned 1 exit status [mythcat@desk fasm]$ gcc -Wall -g `pkg-config --cflags gtk+-3.0` button.o -m32 -o button `pkg-config --libs gtk+-3.0` /bin/ld: cannot find -lgtk-3 /bin/ld: cannot find -lgdk-3 /bin/ld: cannot find -lpangocairo-1.0 /bin/ld: cannot find -lpango-1.0 /bin/ld: cannot find -lharfbuzz /bin/ld: cannot find -latk-1.0 /bin/ld: cannot find -lcairo-gobject /bin/ld: cannot find -lcairo collect2: error: ld returned 1 exit status |
|||
05 Oct 2020, 20:14 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.