Recent

Author Topic: Cross AND normal compilation through fpcupdeluxe  (Read 663 times)

Escain

  • New member
  • *
  • Posts: 9
Cross AND normal compilation through fpcupdeluxe
« on: February 08, 2023, 11:16:24 am »
Hi :-)

I have installed Lazarus through FpcUpDeluxe on a Windows10 machine with Intel processor, and managed to successfully build and run applications for an ARM-linux target.

Actually, I would like to have the same project also building for that Windows10 machine, so I can test locally (and eventually debug).

FpcUpDeluxe seems to install successfully both architecture: arm-linux AND x86_64-windows.

Now, the issue seems to be either with my project configuration or with the FPC configuration withing lazarus:

[[See attachements]]

Obviously, I am doing something very wrong.

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Cross AND normal compilation through fpcupdeluxe
« Reply #1 on: February 08, 2023, 11:29:03 am »
Your first picture probably hinted you correctly towards your issue.

Check you fpc.cfg and see if that contains the correct paths. The units of a particular platform are searched for in a platform specific directory by default. But you have to explicitly tell FPC that (*).

In your Lazarus project options, compiler options, verbosity you can select different settings. When you check one of those (additional) options then the compiler will spit out more information for example on what files are tried. I usually use the option -va (show everything) to let FPC produce a full log of everything, save that and view that in a text editor to see what goes wrong. It shows what configuration file is used, which macros are active, which directories are searched for/in and which files are tried etc.

I am assuming that you already (cross) compiled your units for the platform that you wish to target.

(*) in an attempt to make it more clear, my fpc.cfg contains the following lines:
Code: [Select]
# searchpath for units and other system dependent things
-Fu[fpc_basedir]/[fpc_version]/units/$fpctarget/*
-Fu[fpc_basedir]/[fpc_version]/units/$fpctarget/rtl
where the square-bracketed items are corresponding with their actual location on disk. There are no square brackets in the configuration lines themselves.

Such setup requires that all (compiled) units are located in the units directory which contains subdirectories based on their target name.

Because you also seem to be targeting an embedded target (?) you also might have to use the $fpcsubarch and $fpcmemorymodel for such a specif target that requires it. You can use the #ifdef and #endif declarations to place such targets in a separate section.
« Last Edit: February 08, 2023, 12:10:01 pm by TRon »

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Cross AND normal compilation through fpcupdeluxe
« Reply #2 on: February 08, 2023, 12:50:12 pm »
Obviously, I am doing something very wrong.
Target OS=Win32 and CPU=x86_64 is not possible. Either make OS=Win64 and CPU=x86_64, or OS=Win32 and CPU=i386. If you do not have everything needed for both 32 and 64 bit (cross) compilation, then only one of those will work.
« Last Edit: February 08, 2023, 12:52:31 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Cross AND normal compilation through fpcupdeluxe
« Reply #3 on: February 08, 2023, 01:23:20 pm »
Target OS=Win32 and CPU=x86_64 is not possible.
Oops, completely overlooked that  :-[  Thank you for the correction avra

Escain

  • New member
  • *
  • Posts: 9
[SOLVED] Cross AND normal compilation through fpcupdeluxe
« Reply #4 on: February 09, 2023, 10:09:12 am »
Target OS=Win32 and CPU=x86_64 is not possible. Either make OS=Win64 and CPU=x86_64, or OS=Win32 and CPU=i386. If you do not have everything needed for both 32 and 64 bit (cross) compilation, then only one of those will work.

Ooh, yes! that was it. Thank you.
Actually FpcUpDeluxe return success on the install, but the folder is not really populated.

I switched to Win32 + I386 and all Ok.

Thank you for your help :-)

 

TinyPortal © 2005-2018