Forum > General

Cross AND normal compilation through fpcupdeluxe

(1/1)

Escain:
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:
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: ---# searchpath for units and other system dependent things
-Fu[fpc_basedir]/[fpc_version]/units/$fpctarget/*
-Fu[fpc_basedir]/[fpc_version]/units/$fpctarget/rtl

--- End code ---
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.

avra:

--- Quote from: Escain on February 08, 2023, 11:16:24 am ---Obviously, I am doing something very wrong.
--- End quote ---
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.

TRon:

--- Quote from: avra on February 08, 2023, 12:50:12 pm ---Target OS=Win32 and CPU=x86_64 is not possible.

--- End quote ---
Oops, completely overlooked that  :-[  Thank you for the correction avra

Escain:

--- Quote from: avra on February 08, 2023, 12:50:12 pm ---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.

--- End quote ---

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 :-)

Navigation

[0] Message Index

Go to full version