Recent

Author Topic: Cross-Compiling from Suse 15.2 to Win64  (Read 8419 times)

diogenes

  • Jr. Member
  • **
  • Posts: 59
    • http://members.chello.at/diogenes
Re: Cross-Compiling from Suse 15.2 to Win64
« Reply #15 on: July 17, 2021, 08:33:13 am »
Apart from having been sick for a few days, I was busy elsewhere. Sorry

1) Indeed use FPC 3.2.0
2) When I look for the unit by Alt+Up, I get the (translated) message, "fcllaz.pas (11,3) Fatal: Cannot find db used by fcllaz from Package FCL. "
3) I found db.pas in /usr/share/fpcsrc/3.2.0/packages/fcl-db/src/base/ but when I include this, I get the same results :(

dbannon

  • Hero Member
  • *****
  • Posts: 1470
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Cross-Compiling from Suse 15.2 to Win64
« Reply #16 on: July 17, 2021, 01:10:06 pm »
Hmm, do you have this problem when compiling a 'native' app ?  That is one for Linux, 64bit ?

Please go to Lazarus Tools->Options->Environment->Files
That has a field, "FPC Source Directory", in your case it should be, perhaps "/usr/share/fpcsrc/3.2.0" - please confirm that.

When you were doing your setup earlier, you did run "sudo make all OS_TARGET=win64 CPU_TARGET=x86_64" didn't you ?   I ask because the instructions on https://wiki.freepascal.org/Cross_compiling_for_Win32_under_Linux look a bit disjointed I must admit.  I use use my own notes that are specific to my install.

I have just built a suse Leap 15.3 VM as part of my test process for my app, I think I have better do what you are trying there and document it from scratch.

I'd assume FPC and Lazarus from sourceforge, as RPMs in this case and you wan to end up making windows binaries.  In the past, I have always found this easy, the hard part is getting the 64->32bit stuff !

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

dbannon

  • Hero Member
  • *****
  • Posts: 1470
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Cross-Compiling from Suse 15.2 to Win64
« Reply #17 on: July 17, 2021, 03:04:17 pm »
Ah, diogenes, I have just built a system here on a SUSE VM and you will be very pleased to know that I can achieve exactly the same result,

fcllaz - cannot find db unit !

Maybe you missed the instruction to add something to fpc config file to tell it your new windows units were compiled to  -

Code: [Select]
/usr/share/fpc/3.2.0/units/x86_64-win64/fcl-db/db.o   // and db.ppu
that means you need to add a line into your fpc.cfg file that tells the compiler where to look for those units, you can either edit /etc/fpc.cfg as root or copy it to your home dir and call it .fpc.cfg  but either way, it needs a line, ideally just under this comment as shown

Code: [Select]
# searchpath for units and other system dependent things
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*

That made it all work here.

Please let us know if this solves your problem, the cross compiling page is a mess, it will make me do something about it ....

Davo



Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

diogenes

  • Jr. Member
  • **
  • Posts: 59
    • http://members.chello.at/diogenes
Re: Cross-Compiling from Suse 15.2 to Win64
« Reply #18 on: July 18, 2021, 09:55:41 am »
Do you mean -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* literally or shall I replace the directories beginning with $ with explicit ones?

By the way, I was tipped off in this thread for installing wine and the windows version of lazarus to make Windows binaries. Works well :)

dbannon

  • Hero Member
  • *****
  • Posts: 1470
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Cross-Compiling from Suse 15.2 to Win64
« Reply #19 on: July 18, 2021, 01:19:53 pm »
Do you mean -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* literally or shall I replace the directories beginning with $ with explicit ones?

By the way, I was tipped off in this thread for installing wine and the windows version of lazarus to make Windows binaries. Works well :)

Exactly that line as shown. If you look in fpc.cfg, you will see lots of similar lines, at compile time the $something variables are resolved.

I have replaced a lot of the old content of the wiki page on making a Linux->Windows cross compiler and I consider it a lot more readable. There was content about updating your fpc.cfg in there but it was so convoluted you can be well and truly be excused for missing it.   I would appreciate it if you had a quick look to see if you would have been more more successful if you used it instead.

If using wine works for you, great !  But I use a set of cross compilers to release my application (and lots of pre-release test bundles) and do not regret the effort of setting it up. A lot might depend on what you are doing, if its a long term project....

I can spit out 64 and 32bit deb and rpm packages and two Windows executables with one script. 

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

 

TinyPortal © 2005-2018