Marco van de Voort �rta:
Show quoted text 24 lines
>Beacuse no one replied, I thought that it might be useful to spend the
>whole night with googling, and searching the answers for this cross
>compiling :)
>Now it somewhat clearer for me, what should I do.
>I found a new howto, which explains this thing a little bit simpler.
>Now I realized, that lazarus need these tools (asw, dlltools etc...) to
>compile the project to win32. I think that those utils will be there,
>after I compiled my new gcc, as I read it on the web-page (am I right?).
>My problem is that I can not compile the new gcc(3.3.1).
You don't need gcc. You are looking at compiling C programs cross platform with gcc.
You don't have C programs, you have Pascal programs (FPC). So you need a cross pascal
compiler.
However it happens that FPC can generate code for all operating systems on
an architecture using one binary. (ppc386 in this case)
What you need are cross binutils. These are on ftp (freepascal.stack.nl), and if
you need to hand build them, see the script in the fpc source repository (fpc/install/cross)
Then you need to compile the parts of FPC that are OS specific (the libraries) for win32.
In the same CVS dir (fpc/install/cross) there is script that does just that.
Thanks for the lot of help, now I realized, that I already have those ldw, asw binaries which are needed by lazarus, because the howto told me to compile a new binutils. Then I just don't understand why it told me to compile the gcc... So I've copied those binaries to my $PATH, and set up lazarus to build to win32, and set up the LCL to win32. Please allow me to paste the lazarus's output when I try to compile my project to win32:
-------------###-------------
...
...
...
[TCompiler.Compile] CmdLine="/home/leva/FreePascal/bin/ppc386 -Rintel -S2cgi -CD -Ch8000000 -OG1p1 -TWin32 -gl -XD -vewnhi -l -Fu/home/leva/FreePascal/Lazarus/lcl/units/
-Fu/home/leva/FreePascal/Lazarus/lcl/units/win32/
-Fu/home/leva/FreePascal/Lazarus/packager/units/ -Fu. -o/home/leva/tmp/project1.exe -dLCL /home/leva/tmp/project1.lpr" TOutputFilter: "Hint: Start of reading config file /home/leva/.fpc.cfg" TOutputFilter: "Hint: End of reading config file /home/leva/.fpc.cfg" TOutputFilter: "Free Pascal Compiler version 1.0.10 [2003/06/26] for i386" TOutputFilter: "Copyright (c) 1993-2003 by Florian Klaempfl" TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/" not found" TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/rtl/" not found" TOutputFilter: "Target OS: Win32 for i386"
TOutputFilter: "Compiling /home/leva/tmp/project1.lpr" TOutputFilter: "syswin32.pp(5,1) Hint: Conditional I386 was set at startup in last compilation of syswin32.pp"
TOutputFilter: "math.pp(6,13) Hint: Conditional I386 was set at startup in last compilation of math.pp"
TOutputFilter: "Compiling unit1.pas"
TOutputFilter: "Linking /home/leva/tmp/project1.exe" TOutputFilter: "47 Lines compiled, 1.9 sec"
[TCompiler.Compile] end
NOTE: No debugger defined. Starting program without debugging ... EXECUTING "/home/leva/tmp/project1.exe"
WorkingDir "/home/leva/tmp/"
[TMainIDE.DoRunProject] END
Xlib: unexpected async reply (sequence 0x1bef4)!
Xlib: unexpected async reply (sequence 0x1c79a)!
Gdk-WARNING **: GdkWindow 0x4a00461 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4a00460 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4a0045f unexpectedly destroyed Gdk-ERROR **: X connection to :0.0 broken (explicit kill or server shutdown).
-------------###-------------
As you can see, my lazarus has been closed. After I clicked the Run button, I could read the messages window, and it told me that, the "Project "project1" Succesfully built :)". But, right after that, all of the lazarus's windows closed. I have compiled lazarus by hand, but I'm using the precompiled version of fpc(ppc386) v1.0.10.
I think I can ignore these lines:
TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/" not found" TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/rtl/" not found"
because I have installed those libs to an other directory, and I specified this in my .fcp.cfg:
-Fu/home/leva/FreePascal/lib/fpc/1.0.10/units/$target -Fu/home/leva/FreePascal/lib/fpc/1.0.10/units/$target/* -Fu/home/leva/FreePascal/lib/fpc/1.0.10/units/$target/rtl
So I think lazarus found the win32 libs, after searching in these pathes.
But to take no risk, I have symlinked that win32 dir to /usr/lib/.... directory, and tried to Run the project again, and the same happened: lazarus has been terminated.
The error messages are not the same every time, so I paste some other messages as well:
-------------------###-------------------
TOutputFilter: "Linking /home/leva/tmp/project1.exe" TOutputFilter: "47 Lines compiled, 1.8 sec"
[TCompiler.Compile] end
NOTE: No debugger defined. Starting program without debugging ... EXECUTING "/home/leva/tmp/project1.exe"
WorkingDir "/home/leva/tmp/"
[TMainIDE.DoRunProject] END
Xlib: unexpected async reply (sequence 0xac4e)!
Xlib: unexpected async reply (sequence 0xcb23)!
Gdk-WARNING **: GdkWindow 0x4a00461 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4a00460 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4a0045f unexpectedly destroyed
Gtk-CRITICAL **: file gtkobject.c: line 1080 (gtk_object_get_data): assertion `GTK_IS_OBJECT (object)' failed.
Gdk-ERROR **: X connection to :0.0 broken (explicit kill or server shutdown).
-------------------###-------------------
and another:
-------------------###-------------------
TOutputFilter: "Compiling /home/leva/tmp/project1.lpr" TOutputFilter: "syswin32.pp(5,1) Hint: Conditional I386 was set at startup in last compilation of syswin32.pp"
TOutputFilter: "math.pp(6,13) Hint: Conditional I386 was set at startup in last compilation of math.pp"
TOutputFilter: "Compiling unit1.pas"
TOutputFilter: "Linking /home/leva/tmp/project1.exe" TOutputFilter: "47 Lines compiled, 1.9 sec"
[TCompiler.Compile] end
NOTE: No debugger defined. Starting program without debugging ... EXECUTING "/home/leva/tmp/project1.exe"
WorkingDir "/home/leva/tmp/"
[TMainIDE.DoRunProject] END
Xlib: unexpected async reply (sequence 0xbf22)!
Gdk-WARNING **: GdkWindow 0x4e0161b unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e01605 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e01602 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e01540 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e0153f unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e0153e unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e0153d unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e01548 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e01546 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e01547 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e01545 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e01544 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e01542 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e01543 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e01541 unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e0153c unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e0153b unexpectedly destroyed
Gdk-WARNING **: GdkWindow 0x4e0153a unexpectedly destroyed
Gtk-CRITICAL **: file gtkobject.c: line 1080 (gtk_object_get_data): assertion `GTK_IS_OBJECT (object)' failed.
-------------------###-------------------
I'm running Debian/woody, with glibc_2.2.5-11.5, and: libgtk1.2 1.2.10-11
libgtk2.0-0 2.0.2-5woody1
libglib1.2 1.2.10-4
libglib2.0-0 2.0.1-2
ppc386_1.0.10
lazarus 0.9.0
The binutils that I've compiled to get that asw, and other binaries, is 2.14.
If I'm using the "Run / Build" menu only, then lazarus builds my project, and I can run the output binary under windows. Is it normal that the output binary is very big? I mean, there is nothing in my project, but a plain form, and the windows binary is 3mb ( and under xp, an ms-dos window pops up with the project, I don't know if this is normal...).
The bigger problem is, that lazarus terminates when I click Run. Or is this because Lazarus can not run windows executables, and somewhere in the options, I must specify i.e. a wine binary?
Is this some kind of bug in lazarus, or this is squarely my fault, or my system's fault?
Thanks a lot!
Daniel
LeVA