Problem with GTK and new machine

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

Problem with GTK and new machine

Postby wallyg » May 15, 2018 23:31

My old faithful 8 year old machine finally died and repairing it for the 3rd time did not seem reasonable, especially as the hard drive failed too.

So I now have a brand spanking new Windows 10 machine. ( I cannot thank my wife enough for the allowing me to use such a large portion of our SS income ). I downloaded the latest version of FB 1.0.5. Everything works great. Now I want to run some older GTK programs and after some searches of the internet found a download file and downloaded it. Compiling works fine but the loader gives the following set of errors.

C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lgtk-3
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lgdk-3
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lglib-2.0
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lgthread-2.0
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lgio-2.0
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lgobject-2.0
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lgmodule-2.0
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lpango-1.0
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lcairo
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lgdk_pixbuf-2.0
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lpangocairo-1.0
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -latk-1.0
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -liconv

Am I using the wrong version of FB? I honestly do not remember what I did to download FB. I spent 4+ weeks trying to get all the programs I needed for all the things I do, onto this new machine. And Windows 10 is just enough different from Windows 7 in the some areas as to make it very frustrating.

I looked at gtk.bi and saw it was for GTK 3.16. So I got a download of the GTK 3.16 version and got the same errors.

I even tried copying all the GTK files into the directory containing the source program and that did not help.

I looked at the files in the GTK bin directory and did see files of the format

libgtk-3-0.dll
libgdk-3-0.dll
libglib-2.0-0.dll Oh so close but no cigars!
...

Is the problem a problem with gtk.bi or the GTK dlls or am I just getting that old?

I also found a version of GTK 3.22 but those caused a large number of incompatable errors. Any chance GTK.bi will be updated to 3.22?

Also trying to find any information on GTK in the forums does not work because GTK is not 4 characters long.

Any suggestions on making this work would be greatly appreciated

Wally.
St_W
Posts: 1318
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Problem with GTK and new machine

Postby St_W » May 16, 2018 11:54

Do you still have the DLLs you used on your old machine? This would probably be the easiest solution :-)

e.g. when the Linker gives the following error message:
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lgtk-3
the dll has to be named "libgtk-3.dll". Also make sure that the architecture of the compilation target and the dll do match (windows, 32-bit in this case), otherwise the linker will simply ignore the file.

Have you tried whether your set of DLLs works when you rename them, removing the "-0" suffix? Where did you get the binaries from? Did you build them yourselves?
wallyg
Posts: 79
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: Problem with GTK and new machine

Postby wallyg » May 16, 2018 18:23

The old machine failed and took the hard drive with it or the hard drive failed and took the machine with it. I had all my work backed up but did not bother to backup system files and I had installed libs like this as system files.

I will try renaming the files correctly and let you know.

I will get more information on where these libs came from. Do you know where I should go to get the proper ones for FB - gtk 3.16 to match the included gtk3.bi that comes with FB 1.05 download. I tried the GTK site, but they no longer seem to have the older versions and now use msys2 - pacman and only will load 3.22 which causes the current loader with FB to generate many many inconsistency errors together with these same errors.

As far as I know everything is for 32 bit. I figured I was safer downloading everything to 32 bit. The new machine is so much faster the slight gain in speed for 64 bit was not worth taking any chances.

Thank you for your advice.

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

Re: Problem with GTK and new machine

Postby wallyg » May 16, 2018 20:17

I copied the files with names that matched the missing names and removed the extra "-0" off of the end of the name. So I had the original and modified names in the directory. Contents of both versions were the same.

I then recompiled and original errors disappeared, but now I got the following errors

C:\FB\FreeBASIC\fbc -g -s gui -mt "ccc.bas"

Make done
C:\FB\FreeBASIC\fbc -g -s gui "ccc.bas"
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lgtk-win32-2.0
C:\FB\FreeBASIC\bin\win32\ld.exe: cannot find -lgdk-win32-2.0

Build error(s)

This time I did not find any file "gtk-win32-2.0" with any any additional suffix or even a "libgtk-2in32-2.0" with any suffix. Same for the gdk verision

I got the gtk 3.16 binaries from SOURCEFORGE " gtk+-3.16.6-mingw32-base" - I assume this is the 32 bit version

Does anyone know where else I can down load a version of gtk 3.X 32 bit binaries that work with the default gtk3.bi that comes with FB?

Maybe who ever tested FB 1.05 with the included gtk3.bi can send me a link to the file they downloaded of gtk 3.16 that they verified the system works.

Thank you
Wally
badidea
Posts: 823
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Problem with GTK and new machine

Postby badidea » May 16, 2018 22:00

Did you check this topic: viewtopic.php?f=14&t=18669&hilit=gtk3
There are some links (and posts from you as well).
I just tried some GTK examples on my Linux machine, but also many problems.
If you search for 'lgtk', you will find more trouble: search.php?keywords=lgtk
wallyg
Posts: 79
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: Problem with GTK and new machine

Postby wallyg » May 17, 2018 0:21

I checked the topic and it indicates that there is a set of files for gtk 3.2 from 2012. I will look in to that later, after I clean up the mess I have made trying this that and the other thing to make this work.

It seems that gtk is probably no longer supported from the comments I have read. And there does not seem to be any indication that newer versions will be supported. If this is the case, then removing the gtk.bi from any future newer versions of FB should be done, so other people do not spend days trying to get something to work and not being successful.

If some package is supported with a *.bi file as part of the FB install and does not have the compiled modules included, then at least a simple note in the *.bi file indicating where the version that was used to verify the *.bi file can be found, and as a use at your own risk where newer versions can be found.

I have enjoyed using FB for many years, but its time maybe has come and gone. Thank you to all the people that have put so much work into this system over the years. I will still be trying to get this to work, so if anyone has any helpful ideas or more importantly some good GTK files, I would appreciate it. However for future projects, I may have to dust off my C knowledge and go back to using it. Maybe Python? TK does not look that bad to us.

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

Re: Problem with GTK and new machine

Postby wallyg » May 17, 2018 1:37

I checked out the file in the specified thread. Had to track down a missing #ENDIF in Pixbuf first. It loads ok, but if I try to execute it as a gtk 2 system, a missing file libgtk-win32-2.0-0.dll was not found. Trying the 3.2 version causes gtkbuilder to abort with a C++ error code.
wallyg
Posts: 79
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: Problem with GTK and new machine

Postby wallyg » May 19, 2018 20:39

Finally I got GTK 3.22 (the latest version) to work properly??? The program seems to work. Some routines are not in the gtk.bi that comes with the standard FB download (it is 3.16) - not unexpected since FB has not been updated for way over 2 years.

I made so many changes, updates, reloads, ... I am not sure what actually made it finally work. But since it is working, I am going to use the old adage of "If it is not broke, don't fix it" and not do anything else even trying to figure out what made it work. Maybe someday I will try to figure it out. Older versions just would not work properly, i do not know why, probably my lack of knowledge of how FB mangling and linkers/loaders, the internals of GTK and the compilers it uses work.

I am concerned that some of the structures or constants in 3.22 might be different than defined in FB's gtk.bi. This will only get worse as time progresses for all packages.

If FB is to stay a viable package for new projects (and I really hope it does - I like using it a lot, and I have a large project I need to do this summer), we, the community, need to know whether there is enough commitment remaining by the development team to produce a new version with updated include/lib files. If so (and I really do hope so), maybe a really rough ballpark schedule.

Again thank you to all that have put together this great system.

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

Re: Problem with GTK and new machine - RESOLVED

Postby wallyg » May 20, 2018 23:02

I have reloaded everything from scratch. Reinstalled GTK 3.22 via MSYS2 (32 bit version). Putting the def & lib directories on the path statement worked in the GTK 2 days and early 3.x days (years and years ago). It does not work for 3.22, I get the list of errors as described in the start of this thread.

However I have found that if I insert the following two statements prior to the #Include once "GTK/GTK3.bi" statement, everything works.

#LibPath "C:\msys64\mingw32\def"
#LibPath "C:\msys64\mingw32\lib"

Why the path statement version does not work is not something I understand. I thought the documentation of FB indicated that this was ok. Maybe it is an ordering problem with the linker?

But what ever, the latest version of GTK can be used with FB 1.05. But nothing new from 3.17-3.22 can be referenced in the FB code, since the GTK3.bi file is only up to 3.16.

I am also looking into seeing if I can update GladeToBac to 3.22 also (talked to TFJ) over the summer.

Wally

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 0 guests