Closed gavr123456789 closed 3 years ago
Gavr, Thank you for posting the issue.
Compile it with -Wl,--export-dynamic
option, then the error won't happen.
-Wl
passes \<option> as an option to the linker.GtkBuilder builds the template at runtime.
It refers to the symbol table to find the function get_file_name
.
So, the linker needs to add the symbol table to a.out
.
"-Wl,--export-dynamic! option makes it possible.
$ gcc -Wl,--export-dynamic `pkg-config --cflags gtk4` $1.c `pkg-config --libs gtk4`
There are a shell file comp
in the misc
directory.
You can use it as well.
$ bash comp list3
If you want to use comp
as a command:
$ mkdir $HOME/bin
$ cp comp $HOME/bin/comp
$ chmod +x $HOME/bin/comp
After re-login, you can compile it as follows as well.
$ comp list3
The file comp
is used in section 24 to compile list3.c
.
Thanks, now it works, its really the best guide for GTK 4 now.
I think there should be a mention of this in section 24.
Thank you for your suggestion.
It is helpful to improve this tutorial.
I've modified section 24 and put some explanation about -Wl,--export-dynamic
option.
There are Gtk-CRITICAL when run list3.c example.
Compiled with gcc `pkg-config --cflags gtk4` c.c `pkg-config --libs gtk4`
GTK version: 4.2.1-1 Linux: Arch