Execution Errors with Gtk -3.24

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Post Reply
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Execution Errors with Gtk -3.24

Post by wallyg »

I had a problem with a bad download (living in the desert with 1-2 Meg download speeds and constant breaks in downloads have a tendency of doing this).

So I deleted and reloaded Msys2 completely from the latest version and the latest version of FBC 1.08.01 - Gcc-9.3.0.7z. I am on an up-to-date version of Windows 10 still using the most up-to-date FbEdit. I used the gtk.bi that was provided by my last FBC download.

I used the 64-bit version of FBC and the following to link to GTK

#LibPath "C:\msys64\mingw64\lib"

After fixing up a couple of my errors. I finally got the system to compile without any errors. And the linker also produced no errors. I foolishly patted my back on a job well done. I tried to run the executable from FbEdit and nothing happened. I then tried to load it via Fbdebugger and got a message that it was not a debug executable. I checked and -g and -exx -s gui were both on the FBC log in FbEdit.

I then displayed the directory containing the executable just created in Windows Explorer. And when I opened it, it generated 3 error windows and terminated the run.

The messages in order said

"The code execution cannot proceed because libgtk-3-0.dll was not found"
"The code execution cannot proceed because libgobject-2.0-0.dll was not found"
"The code execution cannot proceed because libglib-2.0-0.dll was not found"

I can find dll with similar names in the msys64\ming64\lib directory but nothing that contains 0-0. And nothing in the FBC lib directory. For instance there is a libgtk-3.dll file, but no libgtk-3-0.dll file. It seems there is an extra "-0" in all the names.

What have I done wrong or have I used the wrong directory? I last used gtk 3.24 this way almost 2 years ago and I seem to remember that it worked.

Thanks for any suggestions.
Wally
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: Execution Errors with Gtk -3.24

Post by wallyg »

I would like to thank the 64 people that checked out my problem. It looks like it is more of a problem than I expected since no one seems to be able to make any suggestions for my problem.

Therefore I am asking if anyone knows where I can find a non-Msys2 version of a 64-bit Windows 10 version of Gtk 3.24 or something close to 3.24 that I can download and use until this problem is solved.

It certainly seems to be some type of mangling problem between what FBC produces for the GTK routine calls generated by the version of gtk/gtk3.bi that is included with the release of FB and whatever C compiler is used to generate the gtk library for Msys2.

Thank you to all that have tried and anyone that can send me a download link.

Wally
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: Execution Errors with Gtk -3.24

Post by wallyg »

The Saga continues. I am posting what I have tried so far with the hope it helps someone that really understands what is going on to figure out the problem.

I found a non Msys2 version of Gtk 3.24 for windows 10. gtk-runtime-3.24.29-2021-04-29-ts-Win64.exe that when executed creates a directory in the "Program Files" directory. I then copied that to a subdirectory of my code c:\Users\wfgaz\Dropbox\GtkSystem\GTK3\bin. I Then changed the #Libpath to point to this directory

#LibPath "c:\Users\wfgaz\Dropbox\GtkSystem\GTK3\bin"

And then tried to compile the program again. This time I got a bunch of linker errors

C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lgtk-3
C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lgdk-3
C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lglib-2.0
C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lgthread-2.0
C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lgio-2.0
C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lgobject-2.0
C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lgmodule-2.0
C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lpango-1.0
C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lcairo
C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lgdk_pixbuf-2.0
C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lpangocairo-1.0
C:\FB\FreeBASIC-1.08.1-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -latk-1.0

I then examined the gtk/gtk3.bi file that comes with the compiler. I found that there was a reference to

#inclib "gtk-3"

So I tried changing it to

#inclib "gtk-3-0"

And recompiled again. This time the cannot find -lgtk-3 error message disappeared. So I went through all the gtk files that referenced the errors and changed the #inclib commands to reference files in the new gtk library. Finally, I got all those linker errors to disappear and finally created a *.exe file. I then tried to run it and got back all the original errors from the system about the same missing files at runtime.

I checked my code and verified that

#LibPath "c:\Users\wfgaz\Dropbox\GtkSystem\GTK3\bin"

Referenced the correct directory.

And yes the gtk 3.24 files were all there including the ones referenced on the execution of the created *.exe file. They were obviously referenced correctly by the linker from that directory because the linker errors went away but could not be found at execution time from the #Libpath statement.

I then copied all the files from the ...\bin directory to the directory containing the *.exe file and recompiled and again tried to execute it.

Nothing happened. So I loaded up the 64 bit version of the fbdebugger and tried to load the executable into it. As it was loading the file before I could do anything I got an error message from the debugger. "Unknown DW_OP" "<7a55> DW_AT_type :<07a2b>. Entering OK just continued to give more similar errors.

I have no information on how either the Msys or the standalone library were generated or the compiler used by either one. Obviously, both systems seem to generate a different name for the various compiled dll's. One generates libgtk-3.dll.a and the other generates libget-3.0.dll.

At this point, I am at a loss on how to proceed. But the supplied gtk/gtk3.bi does not seem to work with either version of the gtk 3.24 libraries.

If someone has a version of gtk/gtk3.bi and a gtk 3.24 library that links and executes correctly with the current version of the compiler, I would greatly appreciate getting a copy of both.

Thanks

Wally
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Execution Errors with Gtk -3.24

Post by TJF »

Did you try the headers at

https://github.com/dtjf/gir_headers

They're looking for a libgtk-3.0.dll binary, and should work with the (official) msys2 installation.

Note: There're two linkers
  • the compile-time linker called by fbc (using #LIBPATH)
  • the run-time linker called by the OS (using environment PATH)
So you've to set both, #LIBPATH in FB-source and OS environment PATH variable to C:\msys64\mingw64\lib

BTW:
On a LINUX system the package manager does all that for you.
wallyg
Posts: 267
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: Execution Errors with Gtk -3.24

Post by wallyg »

Thank you, I will certainly give them a try.

Just as a note. I originally indicated I reloaded the Msys2 system because of a perceived bad download (Happens 5% of the time with my provider here in the desert - only one that works here at all). Well, I was having some other weird things too, so I called a buddy who is a professional IT guy for a large company. He thinks my hard drive may be the root of the problem. So he will be putting a new one in and re-installing Windows 10 from scratch this week. I will then re-download all the required software and re-attach all my cloud storage ( all non-software items are backed up to two different clouds ) and I do a weekly backup to a separate standalone hard drive. And I can go back to my main machine and off this 11-year-old laptop.

Thanks to everyone that looked and thought about what might have been happening to me.

Thank you, Thank you, Thank you all for everything and all the great software available.

Wally
Post Reply