Page 2 of 2

Posted: Tue Nov 30, 2010 3:06 am
by y offs et
I confirm compiling instructions work for win32 with one note:

"4 - In the Syntax tab ..." - observe (X) Allow inline

as this is not default.

-------------------------------------------

Now for the bad news. Only action is swapping in the renamed Player.bin (it's enormous) - fails to compile a project with the following error. It gives an enormous .exe (35 kb, usually) , and is just a command window.
Using rev. 260 and absolutely latest ZGE beta.

----------------------------------------

By the way, I also got it to compile through Lazarus with pretty much the same result. I could post about it when we get this sorted out.

Posted: Tue Nov 30, 2010 8:21 am
by VilleK
The "resource not found" warnings in ZGE can be ignored, however you need to uncheck "Remove unused code" menuitem because that is not compatible with FP-generated binaries.

Exe-files are generally larger in FP. We could try to size-optimize for FP too but it requires quite a lot of detailed work so I would need help with that because I am mainly focused on Delphi. The appearance of the console window is strange because I don't remember that from previous FP-versions, possibly there is another FP command line switch that needs to be set. I know Kjell has encountered this too so maybe he has something to add here.

Posted: Tue Nov 30, 2010 11:24 am
by y offs et
Ah... interesting result. Now the FPC result is a flashing command window (like the Lazarus was), and the Lazarus result works correctly. :)

Posted: Tue Nov 30, 2010 12:28 pm
by y offs et
Lazarus instructions

---------------------

Lazarus Version#:0.9.29

------------------------------------

Lazarus / fpc / 2.4.0 / bin / i386-win32 / fpc.cfg

# -u is the same as #UNDEF
#
-dMINIMAL
#

------------------------------------

Now start Lazarus

1. File / Open / All Files so ZzDC.dpr becomes visible
2. Select - create project dialog message - yes
3. FPCUnit Test Application - yes

4. Project / Project Options / Compiler options / Parsing
5. Syntax mode - Delphi
6. Syntax options - check 1 , 3 , 4 , 8
7. Assembler style - Intel
OK

Run Menu / Build

Done

Proceed with moving and renaming Zzdc.exe to Player.bin

Posted: Tue Nov 30, 2010 9:20 pm
by y offs et
Being the curious chimp I am, I continued on with Lazarus to see if it could compile ZDesigner.

Overcame numerous problems with fixes until it hit
OpenGL12
9225 ... CharInSet ...

which must be a Delphi 2010 command because it doesn't appear anywhere in the svn files.

Oh well :)

Posted: Wed Dec 01, 2010 1:27 pm
by VilleK
You were brave to attempt this :)

CharInSet is a function that was introduced in Delphi 2009 to replace the syntax like "'a' in charset'" using Unicode characters, however I suspect this is just one of many problems that occurs when using Lazarus.

Posted: Thu Dec 01, 2011 5:52 am
by nadams
I just tried to compile with FreePascal 2.4.4 with trunk revision 298 (latest as of writing this message) using the makeFpcWin32.bat script in /build and I get the following error message:

Code: Select all

Compiling ZOpenGL.pas
Assembling zopengl
Fatal: Can't find unit Winapi used by ZPlatform
Fatal: Compilation aborted
However, I was able to compile the tagged version 1.9.7 without any issues.

Posted: Thu Dec 01, 2011 8:22 am
by VilleK
I'll check it out. I haven't tried it for a while because I usually build with Delphi. Does the makeFpcSDL.bat file work?

Posted: Thu Dec 01, 2011 6:32 pm
by VilleK
There are later development builds of FPC. Try 2.7.1 for Windows here: ftp://ftp.freepascal.org/pub/fpc/snapsh ... 386-win32/

Also get the latest ZGE source, I checked in a minor change.

Then the build works fine here.

Posted: Fri Dec 02, 2011 3:45 am
by nadams
VilleK wrote:There are later development builds of FPC. Try 2.7.1 for Windows here: ftp://ftp.freepascal.org/pub/fpc/snapsh ... 386-win32/

Also get the latest ZGE source, I checked in a minor change.

Then the build works fine here.
Doh! I'm not familiar with FPC builds sorry about that.

I can build both the Win32 and SDL versions now. However, from the instructions in the first post if I take "zzdc.exe" and rename it to Player.bin and put it in my ZGameEditor folder (after renaming the original) after running "build and run" the generated game crashes. This happens for the SDL version as well. For SDL I'm using version 1.2.14-win32.

I'm running Windows 7 x64.

I noticed that as.exe did not come with the release of FPC that you linked to, so I "borrowed" it from my install of 2.4.4 - that might have something to do with it?

Here is the output from when I tried to build (without copying as.exe from 2.4.4):

Code: Select all

C:\svn\zgameeditor\trunk\Build>makeFpcWin32.bat
ZMath.pas(432,1) Error: Assembler as.exe not found, switching to external assemb
ling
ZMath.pas(432,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: C:\FPC\2.7.1\bin\i386-win32\ppc386.exe returned an error exitcode (normal
 if you did not specify a source file to be compiled)
C:\svn\zgameeditor\trunk\Build>makeFpcSDL.bat
ZMath.pas(432,1) Error: Assembler as.exe not found, switching to external assemb
ling
ZMath.pas(432,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: C:\FPC\2.7.1\bin\i386-win32\ppc386.exe returned an error exitcode (normal
 if you did not specify a source file to be compiled)
C:\svn\zgameeditor\trunk\Build>

Posted: Fri Dec 02, 2011 9:02 am
by VilleK
Freepascal is always catching up with the latest language features in the Delphi language and they make public release very seldom so for the best result you need to install development builds or download the source and build it yourself. But it is not easy to figure out where they are from their homepage :)

The develop builds perhaps are not complete with all tools, I just unzipped the latest version on top of the older version, that seemed to work.

About the binaries crashing, I found out it is because by default the option "Remove unused code" in Project menu is turned on. It improves the generated files compression ratio when running through a compress tool. And that feature use the map-file that (afaik) only the Delphi compiler generates. So if you want to use Fpc-generated player-file then it is easiest to just rename ZZDC.map file to something else because that disables the feature (the menu option is always on each time you restart so renaming the map-file is a more persistent solution).