Recent

Author Topic: gir2pascal @zeljko GTK3 on Windows  (Read 369 times)

iahung

  • New Member
  • *
  • Posts: 22
gir2pascal @zeljko GTK3 on Windows
« on: November 19, 2022, 02:31:13 pm »
Have a look at the files on lcl\interfaces\gtk3\gtk3bindings @zeljko

You are the maintainer of gir2pascal GTK3? Your tool doesn't take GTK3 on Windows into account. Lazarus builds with GTK3 fine, but failed to link because it's still looking for .so.0 of Linux!
« Last Edit: November 19, 2022, 03:08:50 pm by iahung »

iahung

  • New Member
  • *
  • Posts: 22
Re: gir2pascal @zeljko GTK3 on Windows
« Reply #1 on: November 19, 2022, 03:18:36 pm »
The most interesting part is. Even though the files are said to be shouldn't edit, I modified them anyway. I set the correct extension for library on Windows, but Lazarus still failed to link saying it's unable to find import library. What's it trying to find and failed to find?

The dlls are in: C:\msys64\mingw64\bin

The .a import libraries are in: C:\Active\msys64\mingw64\lib

I did trial and error with all of the possible file extensions and names for the libraries. But it still failed to find and link them! So, what's really going on?

Revisit the bindings for GTK2, I found it used the correct syntax for dynamic link. The gir2pascal generated GTK3 bindings doesn't. It used the syntax for static linking (needs import library), but it uses the library name (.so.0) for dynamic linking (.so.* is dynamic library).

Update: Please note C:\msys64\mingw64\bin and C:\msys64\mingw64\lib are both added to PATH so Lazarus (FPC indeed) should be able to find the libraries!
« Last Edit: November 19, 2022, 03:21:18 pm by iahung »

zeljko

  • Hero Member
  • *****
  • Posts: 1381
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: gir2pascal @zeljko GTK3 on Windows
« Reply #2 on: November 19, 2022, 03:41:12 pm »
Open an issue about it and attach patch for windows

iahung

  • New Member
  • *
  • Posts: 22
Re: gir2pascal @zeljko GTK3 on Windows
« Reply #3 on: November 19, 2022, 03:46:51 pm »
Open an issue about it and attach patch for windows

If I have such a patch. Currently I'm not yet touch gir2pascal but trying to modify the generated headers to have Lazarus correctly links the needed libraries. So far I have failed. Please read my post again. I described everything in detail and very clear.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10475
  • FPC developer.
Re: gir2pascal @zeljko GTK3 on Windows
« Reply #4 on: November 19, 2022, 05:18:16 pm »
Open an issue about it and attach patch for windows

gir2pascal got some windows support in july. It is now in the Lazarus tree.

But taking modern .gir files will cause quite considerable differences, which is why I didn't (I only needed up to gobject). Also .gir files are not entirely platform independent.
« Last Edit: November 19, 2022, 06:15:16 pm by marcov »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10475
  • FPC developer.
Re: gir2pascal @zeljko GTK3 on Windows
« Reply #5 on: November 19, 2022, 05:18:56 pm »

The dlls are in: C:\msys64\mingw64\bin

The .a import libraries are in: C:\Active\msys64\mingw64\lib

Paths are not handled by the headers but by you. Pass the relevant parameters (e.g. -Fl).

 

TinyPortal © 2005-2018