FreePascal

Share your ZGE-development tips and techniques here!

Moderator: Moderators

User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et » Tue Nov 30, 2010 3:06 am

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.
Attachments
1.gif
1.gif (27.34 KiB) Viewed 9185 times
"great expectations"

User avatar
VilleK
Site Admin
Posts: 2025
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Tue Nov 30, 2010 8:21 am

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.

User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et » Tue Nov 30, 2010 11:24 am

Ah... interesting result. Now the FPC result is a flashing command window (like the Lazarus was), and the Lazarus result works correctly. :)
"great expectations"

User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et » Tue Nov 30, 2010 12:28 pm

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
"great expectations"

User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et » Tue Nov 30, 2010 9:20 pm

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 :)
"great expectations"

User avatar
VilleK
Site Admin
Posts: 2025
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Wed Dec 01, 2010 1:27 pm

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.

nadams
Posts: 9
Joined: Wed Nov 30, 2011 10:52 am

Post by nadams » Thu Dec 01, 2011 5:52 am

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.

User avatar
VilleK
Site Admin
Posts: 2025
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Thu Dec 01, 2011 8:22 am

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?

User avatar
VilleK
Site Admin
Posts: 2025
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Thu Dec 01, 2011 6:32 pm

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.

nadams
Posts: 9
Joined: Wed Nov 30, 2011 10:52 am

Post by nadams » Fri Dec 02, 2011 3:45 am

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>

User avatar
VilleK
Site Admin
Posts: 2025
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Fri Dec 02, 2011 9:02 am

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).

Post Reply