Help!I dont get it!Cross compile linux to win32....... lazarus / 3-General ---------------------------------------------------------------------- belajardelphi · 2006-02-14 05:48 I download fpc crosswin and i don't know what I have to do with that... I try read about cross compile on lazarus wiki and I'm still don't understand. Please tell me how to compile my program from linux to win32 so i can run in my Windows XP i'm using fpc 2.0.2 and lazarus 0.9.12, and fpccrosswin on Suse 93 Thanks! ---------------------------------------------------------------------- mikiwoz · 2006-02-14 10:01 install lazarus, install fpccrosswin, and when you have them installed, open Lazarus and: go to the Project -> Compiler Options menu and   in Paths -> Target Widgetset choose Win32   in Code -> Target Os chose Win32   in Linking select Win32 GUI application after that, go to Tools -> Configure Build Lazarus menu and   set LCL Interface to Win32   mark only Build LCL as Build + Clean, mark everything else as None after that go to Tools -> Rebuild Lazarus and rebuild it (actually you will only rebuild the LCL - the only thing you need for cross- compiling) When the cross-compiling of LCL is done, you can now cross-compile your project. Remember to *always* set the following before cross- compilation: in the Project -> Compiler Options menu:   in Paths -> Target Widgetset set to Win32   in Code -> Target Os set to Win32   in Linking select Win32 GUI application and compile your project. you should get a perfectly working Windows exe. Cheers Mike ---------------------------------------------------------------------- pinguin · 2006-02-16 15:14 I think  I do exactly like you explain..but i guess i mess up somewhere(maybe i forget something)...so i get this message: if run Lazarus from menu and build lazarus with  win32 LCL i have message ( i'm not sure iwill check again..): make[2]: *** [../../units/i386-linux/win32] Error 1 then i go to virtual console try to run lazarus as root su password:***** #lazarus build lazarus  with win32 lcl (like u r instruction) Then i got message "Clean Lazarus Source" completed /usr/lib/lazarus/lcl/interfaces/win32/win32int.pp(1,1) Fatal: Can't find unit Windows ---------------------------------------------------------------------- pinguin · 2006-02-18 02:58 I have build LCL and  I have message /usr/lib/lazarus/lcl/interfaces/win32/win32proc.pp(865,2) Note: User defined: Should be moved to WSWin32Forms, if the windowproc is splitted /usr/lib/lazarus/lcl/interfaces/win32/win32proc.pp(949,2) Note: User defined: Belongs in Win32WSForms, but is needed in windowproc /usr/lib/lazarus/lcl/interfaces/win32/win32winapi.inc(1359,4) Warning: User defined: TWin32WidgetSet.FrameRect TODO: optimize ARect copying "Build LCL" completed I can crosscompile to win32 ( it  work find when i try iy on winxp) but the lazarus crash after succesfulcros compile ---------------------------------------------------------------------- mikiwoz · 2006-02-18 20:12 strange, I have no problems on Lazarus 0.9.10... have to try the 0.9.12. maybe you could run Lazarus from the console window and paste the output here? Cheers Mike ---------------------------------------------------------------------- pinguin · 2006-02-24 13:23 This is message if i cross compile an aplication to win32 ( I make a blank form and cross compile it) Compiling ../myproject/PEazySqlpass.lpr Linking /home/user/myproject/peazysqlpass.exe 15 Lines compiled, 6.4 sec [TCompiler.Compile] end TBaseCompilerOptions.CreateTargetFilename MainSourceFileName=/home/user/myproject/PEazySqlpass.lpr OutFilename=peazysqlpass TargetFilename= [TDebugManager.DoInitDebugger] A TBaseCompilerOptions.CreateTargetFilename MainSourceFileName=/home/user/myproject/PEazySqlpass.lpr OutFilename=peazysqlpass TargetFilename= [TDebugManager.OnDebuggerChangeState] state: dsIdle TBaseCompilerOptions.CreateTargetFilename MainSourceFileName=/home/user/myproject/PEazySqlpass.lpr OutFilename=peazysqlpass TargetFilename= [TDebugger.SetFileName] "/home/user/myproject/peazysqlpass.exe" [TDebugManager.OnDebuggerChangeState] state: dsStop [TDebugManager.DoInitDebugger] END [TMainIDE.DoRunProject] B TDebugManager.RunDebugger B TProcessDebugger PR: /home/user/myprojectpeazysqlpass.exe [TDebugManager.OnDebuggerChangeState] state: dsRun [TMainIDE.DoRunProject] END Gdk-WARNING **: GdkWindow 0x2c0020f unexpectedly destroyed Gdk-WARNING **: GdkWindow 0x2c0020e unexpectedly destroyed Xlib: unexpected async reply (sequence 0x2a0b0)! Gdk-ERROR **: BadDrawable (invalid Pixmap or Window parameter)   serial 172210 error_code 9 request_code 70 minor_code 0 Gdk-ERROR **: BadDrawable (invalid Pixmap or Window parameter)   serial 172218 error_code 9 request_code 66 minor_code 0 ---------------------------------------------------------------------- Vincent Snijders · 2006-02-24 15:19 Compilation succeeded. But you cannot run cross compiled win32 applications on linux. ---------------------------------------------------------------------- lepidosteus · 2006-02-28 13:37 Excuse my ignorance, but are you speaking of a way to compile under an os an executable wich will runs under another os ? let's say I'm working under win32, could i compile my project to run under linux using that ? ---------------------------------------------------------------------- matthijs · 2006-02-28 15:32 Yes. It is possible to compile a Windows-executable on a Linux box. (Or vice versa) ---------------------------------------------------------------------- lepidosteus · 2006-02-28 16:14 Does the directive works correctly ? (ie, {$ifdef win32} won't be true if 'im compiling for, let's say linux) If yes, you just made my day and I must give it a try ! ---------------------------------------------------------------------- mikiwoz · 2006-02-28 22:14 yep, the directives work correctly, i.e. if you have and {$IFDEF win32} and compile FOR win32 but UNDER linux - the code in IFDEF WILL be executed, just as it would be being compiled under win32. That's the whole point. Cheers Mike ---------------------------------------------------------------------- lepidosteus · 2006-02-28 22:54 Trying to compile under linux for win32 i have an error when rebulding the LCL, it says 'can't find unit Windows' What path should i add and where ? ---------------------------------------------------------------------- Anonymous · 2006-03-10 22:25 no you can't do this in the other way, I mean, you can't compile for linux from windows ---------------------------------------------------------------------- Vincent Snijders · 2006-03-13 07:26 Quote from: "Anonymous"no you can't do this in the other way, I mean, you can't compile for linux from windows Why not? ---------------------------------------------------------------------- Vincent Snijders · 2006-03-13 07:27 Quote from: "lepidosteus"Trying to compile under linux for win32 i have an error when rebulding the LCL, it says 'can't find unit Windows' What path should i add and where ? You need the fpc units (RTL, FCL and packages) for windows. Install them in PREFIX/lib/fpc/$FPCVERSION/units/i386-win32