Recent

Author Topic: Cross Compile linker problem with GTK3 on a Windows  (Read 2842 times)

BasePointer

  • New Member
  • *
  • Posts: 15
Cross Compile linker problem with GTK3 on a Windows
« 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.
« Last Edit: January 18, 2022, 11:11:33 am by BasePointer »

Zvoni

  • Hero Member
  • *****
  • Posts: 2319
Re: Cross Compile linker problem with GTK3 on a Windows
« Reply #1 on: January 18, 2022, 11:03:17 am »
install pangocairo-dev-package?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

BasePointer

  • New Member
  • *
  • Posts: 15
Re: Cross Compile linker problem with GTK3 on a Windows
« Reply #2 on: January 18, 2022, 11:05:02 am »
install pangocairo-dev-package?

But I'm on windows, Any hint which path I should follow?

Zvoni

  • Hero Member
  • *****
  • Posts: 2319
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

BasePointer

  • New Member
  • *
  • Posts: 15
Re: Cross Compile linker problem with GTK3 on a Windows
« Reply #4 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?

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Cross Compile linker problem with GTK3 on a Windows
« Reply #5 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).

BasePointer

  • New Member
  • *
  • Posts: 15
Re: Cross Compile linker problem with GTK3 on a Windows
« Reply #6 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