Cross compiling problems (Linux -> Win32) lazarus / 1-Linux ---------------------------------------------------------------------- JD · 2014-07-04 08:15 Hi there everyone, I'm trying to set up my Lazarus installation in Linux for cross- compiling. I previously used a virtual machine when I needed to create EXE on several platforms but this is an unnecessary memory hog. I'm trying to follow the steps outlined in the Wiki http://wiki.lazaru s.freepascal.org/Cross_compiling_for_Win32_under_Linux and if I understand correctly, I don't need to touch FPC at all since it can create binaries for many platforms. I only need to compile Lazarus  & LCL components. I followed the instructions in the segment below & Cross compiling the LCL and lazarus components Code: [Select]At the command line: cd lazarus; make clean all OS_TARGET=win32 CPU_TARGET=i386 cd lazarus/lcl; make clean all NOTE: For this to work you also need to add: -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/* to the fpc.cfg in /etc (on ubuntu anyway) and it aborted with the following error (in the terminal) Code: [Select]Free Pascal Compiler version 2.6.4 [2014/04/20] for i386 Copyright (c) 1993-2014 by Florian Klaempfl and others Target OS: Win32 for i386 Compiling fcllaz.pas Fatal: Can't find unit system used by fcllaz Fatal: Compilation aborted make[1]: *** [fcllaz.ppu] Erreur 1 make[1]: quittant le répertoire « /usr/share/lazarus/1.2.2/packager/registration » make: *** [registration] Erreur 2 What am I doing wrong? Thanks for your help. JD ---------------------------------------------------------------------- tk · 2014-07-04 08:31 In last days had the same issues. First check if you have only one /etc/fpc.cfg. I had second one in home folder, it was ~/.fpc.cfg. It messed everything up. Check the paths to fpc build in /etc/fpc.cfg. FPC must be compiled and installed according to the wiki. Further I had to copy ppcross386 to ppc386 but as I can see you don't have to do this, your fpc locates the correct compiler. Also delete everything in ~/.lazarus folder (backup first if you don't trust me ) [Edit]: in my case i cross compile from 64bit linux to 32 bit linux but I think in your case it will be similar. tk ---------------------------------------------------------------------- Leledumbo · 2014-07-04 10:53 Quote from: JD on July 04, 2014, 10:15:59 amif I understand correctly, I don't need to touch FPC at all since it can create binaries for many platforms. I only need to compile Lazarus  & LCL components. You miss one thing: the RTL and FPC packages need to be recompiled for your OS as well. Only the compiler is capable of generating binaries for different OSes. ---------------------------------------------------------------------- timppl · 2014-07-14 05:57 Hi Possibly an easier way is to run lazarus under wine on linux. This is what I do. Installation of fpc and lazarus was easy and they work very well under wine HTH Tim ---------------------------------------------------------------------- JD · 2014-07-15 10:57 Quote from: timppl on July 14, 2014, 07:57:00 amHi Possibly an easier way is to run lazarus under wine on linux. This is what I do. Installation of fpc and lazarus was easy and they work very well under wine HTH Tim It is not worth the overhead. The Lazarus deb files work fine so why use WINE? ---------------------------------------------------------------------- BigChimp · 2014-07-15 11:05 One advantage is that you can do at least limited testing of the resulting executable and see how it would behave on Windows...