[Lazarus] Remove package dependency and IDE crashes

Graeme Geldenhuys graeme at mastermaths.co.za
Mon Nov 9 15:51:50 CET 2009


Graeme Geldenhuys schreef:
> Hi,
> 
> I followed the instructions on the Wiki to create a cross-compiler for
> Windows.
> 
>   http://wiki.lazarus.freepascal.org/Cross_compiling#To_Windows
> 
> My current system is Ubuntu 64bit with FPC 64bit. I'm cross-compiling my
> projects to Win32 from inside the IDE.
> 
> I have managed to successfully cross-compile my projects, but the
> process is definitely not simple or quick. Is there some better way of
> doing this from inside the IDE?
> 
> Currently I have to following these steps:
> 
> 1)  Manually created a cross-compile script for fpGUI Toolkit, because
> Lazarus Packages don't seem to support different files for various
> platforms. So I have two .lpk files for Lazarus. One for Linux and one
> for Windows.

What support do you expect? Almost all packages in the components dir are cross 
platform, take for example printers4lazarus package.

> 3) Environment Options: Change Compiler path and FPC Source Path.

Why? Just choose fpc as compiler and let fpc call the ppcXXX compiler based on the 
-P parameter.

> 
> 4) In my Project Compiler Options dialog, go to Code tab and change
> target platform and CPU to 'Windows 32' and 'i386'. Remember, by current
> setup is Linux with 64bit FPC.

These steps are indeed necessary.
> 
> 5) Then due to issue (1), I have to manually add a -Fu<path> in the
> Project Compiler Options dialog - Other tab.

IMHO (1) is not an issue.

> 
> 6) If fpGUI code changed, manually run the cross-compile scrip.

Why don't you let the IDE recompile the package?

> 
> 7) Click Compile in Lazarus.
> 
> 

This step is indeed necessary.

> Finally I have a Windows 32bit executable.
> 

No, just step (4) and (7). (4) could be made a bit faster using the build mode feature.

> Is there ANY better or faster way of doing this?  My next step is to
> simply create a cross-compile script for my project as this will be MUCH
> quicker that the process above.

Maybe.

Vincent




More information about the Lazarus mailing list