Lazarus

Programming => Widgetset => GTK => Topic started by: BasePointer on January 18, 2022, 10:56:30 am

Title: Cross Compile linker problem with GTK3 on a Windows
Post by: BasePointer on January 18, 2022, 10:56:30 am
Hello,

I used fpcupdelux and installed Lazarus v2.3.0 from trunk and enabled all cross compile options on my Windows 10 machine.
My target is to build app which runs on a Linux with aarch64 cpu.

I created an empty lcl form app and changed the widgetset to gtk3 and Target is Linux and CPU is aarch64.

When I try to compile, I get following error. This error disappears if I use gtk2 or Qt5 as a widgetset.
Code: Text  [Select][+][-]
  1. Debug: C:\LazarusIDE\cross\bin\aarch64-linux\aarch64-linux-gnu-ld.exe: cannot find -lgtk-3
  2. Debug: C:\LazarusIDE\cross\bin\aarch64-linux\aarch64-linux-gnu-ld.exe: cannot find -lgdk-3
  3. Debug: C:\LazarusIDE\cross\bin\aarch64-linux\aarch64-linux-gnu-ld.exe: cannot find -lgio-2.0
  4. C:\LazarusIDE\cross\bin\aarch64-linux\aarch64-linux-gnu-ld.exe: cannot find -lpangocairo-1.0

What shall I do to eliminate this linker error? Any suggestions?

Thank you.
Title: Re: Cross Compile linker problem with GTK3 on a Windows
Post by: Zvoni on January 18, 2022, 11:03:17 am
install pangocairo-dev-package?
Title: Re: Cross Compile linker problem with GTK3 on a Windows
Post by: BasePointer on January 18, 2022, 11:05:02 am
install pangocairo-dev-package?

But I'm on windows, Any hint which path I should follow?
Title: Re: Cross Compile linker problem with GTK3 on a Windows
Post by: Zvoni on January 18, 2022, 11:06:21 am
maybe this helps: https://stackoverflow.com/questions/47097976/installing-pango-cairo-on-windows-10-x64
Title: Re: Cross Compile linker problem with GTK3 on a Windows
Post by: BasePointer on January 18, 2022, 11:20:04 am
maybe this helps: https://stackoverflow.com/questions/47097976/installing-pango-cairo-on-windows-10-x64

Thank you but I think the linker needs actual platform libraries, not windows runtimes.
If I'm correct I need to install all asked libraries on my real target platform and copy them back to C:\LazarusIDE\cross\lib\aarch64-linux on my windows machine?
Title: Re: Cross Compile linker problem with GTK3 on a Windows
Post by: PascalDragon on January 18, 2022, 01:31:21 pm
If I'm correct I need to install all asked libraries on my real target platform and copy them back to C:\LazarusIDE\cross\lib\aarch64-linux on my windows machine?

Correct. To link for Linux (or macOS or essentially any *nix) you need to have the libraries in question for the target available on the host system (that's because the ways libraries are linked to executables is slightly different between *nix and e.g. Windows).
Title: Re: Cross Compile linker problem with GTK3 on a Windows
Post by: BasePointer on January 18, 2022, 11:23:47 pm
Correct. To link for Linux (or macOS or essentially any *nix) you need to have the libraries in question for the target available on the host system (that's because the ways libraries are linked to executables is slightly different between *nix and e.g. Windows).

Thank you. I added required libraries into my linux image and then copy all /usr/lib/*.so* files to C:\LazarusIDE\cross\lib\aarch64-linux, it seems the Lazarus successfully compiles for gtk3 widgetset now.
TinyPortal © 2005-2018