Can't compile with Pascal

Using the Pascal version of SwinGame and you've found a bug? Let us know about it and we will look into it when we get a chance.

Please let us know what operating system you are using, the exact error, when it occurs, etc. the more detail you provide the easier it will be for us to replicate the problem.

Can't compile with Pascal

Postby Hoernchen on Tue Jun 02, 2009 5:04 pm

I have tried going through the first step section using Free Pascal and no matter what I do, it gives me errors every time I try to compile the darn HelloWorld.exe....

Code: Select all
D:\My Documents\Documents\Hoernchen\Programming\SwinGame>winbuild.cmd HelloWorld.exe

SwinGame.ico
************************
Compiling game using FPC
************************
Output can be found in the bin folder
cpp: Too many arguments
windres: GameLauncher.rc:1: syntax error


Why won't it let me compile and gives these errors? I had no previous experience with Pascal yet, so I am fairly clueless....
Hoernchen
Apprentice
 
Posts: 8
Joined: Sat Dec 13, 2008 1:34 pm

Re: Can't compile with Pascal

Postby acain on Tue Jun 02, 2009 7:31 pm

Can you type the following at the command line and let me know what it outputs

Code: Select all
echo %PATH%
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Can't compile with Pascal

Postby Hoernchen on Tue Jun 02, 2009 9:37 pm

Thanks for the quick reply. I typed in the command and received:

Code: Select all
C:\Documents and Settings\Hoernchen>echo %PATH%
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Tec
hnologies\ATI Control Panel;C:\Program Files\QuickTime\QTSystem\;;C:\Program Fil
es\Free Pascal\bin\i386-Win32


There is one path related to Pascal. Is there supposed to be more than one? I am sorry if this makes me look like a huge newb.
Hoernchen
Apprentice
 
Posts: 8
Joined: Sat Dec 13, 2008 1:34 pm

Re: Can't compile with Pascal

Postby acain on Thu Jun 04, 2009 11:06 am

No thats fine :)

try:

set PATH=C:\Program Files\Free Pascal\bin\i386-Win32
then run the winbuild script again.

The problem is with windres which is used to create the icon for the application.

Let me know how that goes and I'll see if I can work out what is missing :)
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Can't compile with Pascal

Postby Hoernchen on Thu Jun 04, 2009 1:11 pm

I did all that, but I am still getting the same compile error.
Hoernchen
Apprentice
 
Posts: 8
Joined: Sat Dec 13, 2008 1:34 pm

Re: Can't compile with Pascal

Postby acain on Fri Jun 05, 2009 9:04 am

Weird. What version of Windows are you running, and what version of the compiler are you using?
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Can't compile with Pascal

Postby Hoernchen on Sun Jun 07, 2009 12:19 pm

Windows XP with Service Pack 3.
Free Pascal v1.0.10
Hoernchen
Apprentice
 
Posts: 8
Joined: Sat Dec 13, 2008 1:34 pm

Re: Can't compile with Pascal

Postby acain on Tue Jun 09, 2009 5:15 pm

You need to use the latest version of Free Pascal version 2.2.4. You can download it from http://www.freepascal.org/download.var
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Can't compile with Pascal

Postby acain on Thu Jun 11, 2009 9:29 am

I've managed to reproduce this issue with the 2.2.4 compiler.

The problem appears to be that Free Pascal does not like to be installed in a directory that contains spaces (i.e. c:\Program Files\...).

To correct the problem:
1: Un-install Free Pascal
2: Install Free Pascal at the default location (C:\FPC\2.2.4)
3: Add the Free Pascal bin directory (C:\FPC\2.2.4\bin\i386-win32) to your path (http://mercury.it.swin.edu.au/swinbrain ... les_How_To)
4: Try the script again.

Hope this helps.
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Can't compile with Pascal

Postby Hoernchen on Sun Jul 05, 2009 2:27 pm

Ok, thank you, I did what you told me and now it seems to work fine. Thanks a lot for the help :D


Btw, don't want to create a new thread for it, but I am experiencing a problem with Cos, Sin and Tan functions. No matter what value I put into them, I get return values in the millions. This shouldn't be happening, unless my trigonometric knowledge is seriously flawed. However, Sin(0) seems to return the proper answer, 0....
Any idea why this would be happening?
Hoernchen
Apprentice
 
Posts: 8
Joined: Sat Dec 13, 2008 1:34 pm

Re: Can't compile with Pascal

Postby acain on Mon Jul 06, 2009 7:27 pm

Sin, Cos and Tan in SwinGame should work fine, note however that they use Degrees not Radians.
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne


Return to Pascal Bugs

Who is online

Users browsing this forum: No registered users and 0 guests

cron