PDA

View Full Version : Graphix and FPC v1.0.10 Problem.



EmbranceII
09-01-2005, 09:27 AM
OK,i want to take part into the "Dog Fiht" competiotion.
Now,im using FPC v1.0.10 and was abou to choose a Graphic API(or something like that,lol)
So i got Graphix Latest version(made back in 2001,if not mistaken,)
Official site(http://www.cg.tuwien.ac.at/~knapp/graphix_old/gxframe.html)

Now i put everything in the units Dir and then try to Run the gxdemo.pas
wich is found with the package...
I also habe all the requirement like FreeType and all the other stuff needed to work with graphiX.

But i get errors like
:


ttinterp.pas&#40;4343,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4344,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4345,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4346,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4347,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4348,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4349,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4350,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4351,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4352,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4353,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4354,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4355,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4356,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4357,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4358,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4360,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4361,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4362,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4363,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4364,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4365,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4366,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4367,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4368,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4369,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4370,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4371,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4372,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4373,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4374,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4375,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4377,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4378,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4379,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4380,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4381,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4382,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4383,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4384,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4385,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4386,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4387,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4388,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4389,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4390,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4391,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4392,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4394,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4395,30&#41; Error&#58; Incompatible types&#58; got "<unknown type>" expected "<procedure variable type of procedure&#40;PSTORAGE&#41;;>"
ttinterp.pas&#40;4395,30&#41; Fatal&#58; There were 50 errors compiling module, stopping

Bart
09-01-2005, 11:17 AM
Try to use FreePascal 1.9.6. Maybe this helps.

You can also try to set the mode to Delphi (compile with -Sd).

EmbranceII
09-01-2005, 12:26 PM
Hmm...v1.9.6 dont worked:/
How to set the delphi mode?(the -sd)?

Sly
09-01-2005, 10:26 PM
Either -Sd (old parameter) or -Mdelphi (new parameter).

EmbranceII
10-01-2005, 03:27 AM
Badly none of them didnt worked...
It seem a pp file ahs all the errors(see first post)
Could someone check it,and see what wrong?
I cant understand.

WILL
10-01-2005, 05:01 AM
EmbranceII, why not try a graphics library a little less dated?

There are a few to choose from. JEDI-SDL for instance. Or maybe working with just the OpenGL or DirectX headers themselves. SDL is a more cross-platform solution though so you have that advantage there. Plus its a bit more widely used than what you're trying to use.

Best of luck with your efforts. ;)

EmbranceII
11-01-2005, 05:12 AM
1)I would use Jdei-SDL but i cant get to understand any of the commands described...
If they were more "easy" like:
LoadBMP (life.BMP)
i woudl use it but the parametres are many.Eve if they arent the documentation still lacks,so this is my main prob.
2)On the other hand,the GraphiX Doc is very deatailed and easy to understand.Thats why i wanted to use it.

Almindor
11-01-2005, 08:09 AM
SDL is actualy very easy. And you almost hit the spot
"SDL_LoadBMP(PChar);" where PCHAR is the C string with full path to file.
Usage is:
"PSDL_Surface:=SDL_LoadBMP(PChar);"
Where PSDL_Surface is your surface where you want to load it.

The docs are at www.libsdl.org. Go to the wiki page/api for basic SDL.
There are addons to SDL(also documented there) like SDL_Image which will enable you to load other formats as easily ie:
"PSDL_Surface:=IMG_Load(PChar);"

The problem with people nowadays is they can't even find the docs.
(I'm one such type too)

cairnswm
11-01-2005, 11:01 AM
Why not have a look at my S2DL library (announced else where on this site - not sure where). Its a very simple wrapper for SDL that basically lets you code your game while it does all the SDL work for you.

I used it for my FOOGS entry in the 72 hour GDC contest. So its pretty stable- I will probably use if for my DogFight entry as well.

Anonymous
11-01-2005, 01:58 PM
One 1.0.x version of FPC had a deviant way of dealing with procedure variables. This was changed later.

You could also try to compile with -S2, otherwise you have to add or remove a @ from all those error spots.

EmbranceII
12-01-2005, 06:26 AM
OK,i will give a try.
I will check out the S2DL too.

EmbranceII
14-01-2005, 07:05 AM
1)When i try to call SDL is says usint nor found.
I have the whole JediSDL pakag into usint directory under "JediSDL" folder name.
2)Also the S2DL game template dont work...
Logger not found and same for sysutils.

Almindor
15-01-2005, 12:35 PM
Did you just update FPC? you probably broken your paths. If sysutils is not found it means FPC.CFG points to wrong units or no units.
Make sure the uncommented -Fu entries in FPC.CFG point to the right paths(make sure the paths version number is same as FPC version number)

Best thing to do (easiest that is) is to uinstall FPC and get 1.9.6 and install it from scratch. If you're in win32 this should be easy.

cairnswm
15-01-2005, 05:17 PM
The previous versions of S2DL used the Logger.pas unit that came with JEFI-SDL. Based on my internal requirements of defining the level of logging I modified the logger.pas file to create S2DLLogger.pas.

If a unit is using Logger.pas still it should be modified to use S2DLLogger.pas

EmbranceII
15-01-2005, 06:11 PM
1)Ol,i isntalled 1.9.6 from the scratch.
2)Got all the neede stuff an the latest s2dl units(for some reason i had v1.00 only!lol)

i will post my result later.Thanks for your support people.

EDIT:
Didnt worked:
I first entered all files of v1.01 uppon v1.00.the same till latest version (1.03)
i tried to run ball.pp but got his:

error:System unit not found...

Also why remove the -fu entries?It says not to touch them...However i post them here so if anyone could help.

fp.cfg

# Automaticly created file, don't edit.
#IFDEF NORMAL
-TGo32v2
-Sg
-O1
-OG
-Op3
-Ratt
-Fuc:\FPC\units\$FPCTARGET
-Fuc:\FPC\units\$FPCTARGET\*
-Fuc:\FPC\units\$FPCTARGET\rtl
-Cs131072
-Ch2097152
-g-
-p-
-b-

-T$3
#ENDIF

#IFDEF DEBUG
-TGo32v2
-Sg
-Cr
-Ci
-Co
-OG
-Op3
-Ratt
-Fuc:\FPC\units\$FPCTARGET
-Fuc:\FPC\units\$FPCTARGET\*
-Fuc:\FPC\units\$FPCTARGET\rtl
-Cs131072
-Ch2097152
-g
-p-
-b-

-T$3
#ENDIF

#IFDEF RELEASE
-TGo32v2
-Sg
-O1
-O2
-OG
-Op3
-Ratt
-Fuc:\FPC\units\$FPCTARGET
-Fuc:\FPC\units\$FPCTARGET\*
-Fuc:\FPC\units\$FPCTARGET\rtl
-Cs131072
-Ch2097152
-g-
-p-
-b-

-T$3
#ENDIF


and fpc.cfg

#
# Example fpc.cfg for Free Pascal Compiler
#

# ----------------------
# Defines (preprocessor)
# ----------------------

#
# nested #IFNDEF, #IFDEF, #ENDIF, #ELSE, #DEFINE, #UNDEF are allowed
#
# -d is the same as #DEFINE
# -u is the same as #UNDEF
#

#
# Some examples (for switches see below, and the -? helppages)
#
# Try compiling with the -dRELEASE or -dDEBUG on the commandline
#

# For a release compile with optimizes and strip debuginfo
#IFDEF RELEASE
-OG2p3
-Xs
#WRITE Compiling Release Version
#ENDIF

# For a debug version compile with debuginfo and all codegeneration checks on
#IFDEF DEBUG
-g
-Crtoi
#WRITE Compiling Debug Version
#ENDIF

# ----------------
# Parsing switches
# ----------------

# All assembler blocks are intel styled by default
#-Rintel

# All assembler blocks are AT&T styled by default
#-Ratt

# All assembler blocks are directly copied to asm
#-Rdirect

# Semantic checking
# -S2 switch some Delphi 2 extensions on
# -Sc supports operators like C (*=,+=,/= and -=)
# -Sd tries to be Delphi compatible
# -Se<x> compiler stops after the <x> errors (default is 1)
# -Sg allow LABEL and GOTO
# -Sh Use ansistrings
# -Si support C++ styled INLINE
# -Sm support macros like C (global)
# -So tries to be TP/BP 7.0 compatible
# -Sp tries to be gpc compatible
# -Ss constructor name must be init (destructor must be done)
# -St allow static keyword in objects
# Allow goto, inline, C-operators
-Sgic

# ---------------
# Code generation
# ---------------

# Uncomment the next line if you always want static/dynamic units by default
# (can be overruled with -CD, -CS at the commandline)
#-CS
#-CD

# Set the default heapsize to 8Mb
#-Ch8000000

# Set default codegeneration checks (iocheck, overflow, range, stack)
#-Ci
#-Co
#-Cr
#-Ct

# Optimizer switches
# -Og generate smaller code
# -OG generate faster code (default)
# -Or keep certain variables in registers (still BUGGY!!!)
# -Ou enable uncertain optimizations (see docs)
# -O1 level 1 optimizations (quick optimizations)
# -O2 level 2 optimizations (-O1 + slower optimizations)
# -O3 level 3 optimizations (same as -O2u)
# -Op target processor
# -Op1 set target processor to 386/486
# -Op2 set target processor to Pentium/PentiumMMX (tm)
# -Op3 set target processor to PPro/PII/c6x86/K6 (tm)

# Optimize always for Size and PentiumII
#-Og2p3


# -----------------------
# Set Filenames and Paths
# -----------------------

# Both slashes and backslashes are allowed in paths

# path to the messagefile, not necessary anymore but can be used to override
# the default language
#-Frc:\FPC/msg/errore.msg
#-Frc:\FPC/msg/errorn.msg
#-Frc:\FPC/msg/errores.msg
#-Frc:\FPC/msg/errord.msg
#-Frc:\FPC/msg/errorr.msg

# path to the gcclib
#-Flc:\FPC/lib

# searchpath for includefiles
# release them only if you know what you do
# because this could cause a rebuild of the runtime library
# if you tell them compiler/ide to build the project (FK)
#-Fic:\FPC/source/rtl/inc;c:\FPC/source/rtl/i386

# searchpath for objectfiles
#-Foc:\FPC/source/rtl/inc;c:\FPC/source/rtl/i386

# searchpath for units and other system dependent things
-Fuc:\FPC/units/$FPCTARGET
-Fuc:\FPC/units/$FPCTARGET/*
-Fuc:\FPC/units/$FPCTARGET/rtl

# searchpath for libraries
#-Flc:\FPC/lib
#-Fl/lib;/usr/lib

# searchpath for tools
-FDc:\FPC/bin/$FPCTARGET

# -------------
# Linking
# -------------

# generate always debugging information for GDB (slows down the compiling
# process)
#-gl

# always pass an option to the linker
#-k-s

# Always strip debuginfo from the executable
-Xs


# -------------
# Miscellaneous
# -------------

# Write always a nice FPC logo ;)
-l

# Verbosity
# e : Show errors (default) d : Show debug info
# w : Show warnings u : Show used files
# n : Show notes t : Show tried files
# h : Show hints m : Show defined macros
# i : Show general info p : Show compiled procedures
# l : Show linenumbers c : Show conditionals
# a : Show everything 0 : Show nothing (except errors)

# Display Info, Warnings, Notes and Hints
-viwn
# If you don't want so much verbosity use
#-vw

Almindor
15-01-2005, 06:55 PM
System unit not found means one of 2 things:
Wrong paths or broken install.

Can you post here where you got your FPC sources(if you got them) and there you got FPC itself? Without that knowlidge I can't help you.

EmbranceII
15-01-2005, 07:59 PM
I will take some pictures and upload them somehwere,then post here.please wait a little.

EDIT
Badly i dound no space to up my pics.
However here info:

I got this pack of FPC:
http://prdownloads.sourceforge.net/freepascal/fpc-1.9.6.i386-win32.zip?download

I use WinXP SP@

Also hat do you mean FPC sources?

Almindor
16-01-2005, 07:50 AM
Ok well I reread the entire article again to get a clear picture of what your problem is.

1st. you sayed you have your SDL/S2DL(?) libs in some directory.
Make sure, when you compile your app(which uses them) to add
-Fu<pathtoSDL/S2DL> -Fi<pathtoSDL/S2DL includes>
Or if you use lazarus you can achieve this via:
Projectc/Compiler Options/Other Unit Files and Include Files
Fill in the fields approprietly and your app should compile.

As for the missing System unit I'm not sure. If you installed from the official exe installer there shouldn't be any problems. Perhaps you had an older fpc version before? Maybe your fpc.cfg file points to some old location then.

If nothing helps, try to delete all traces of FPC(sources/libs etc also fpc.cfg) and reinstall.

EmbranceII
16-01-2005, 10:33 AM
OK,i found and solved some of the problems.
1)I enabled Verbose mode and saw the errors.
While it was search for Logger.PAS,it was searching anly root folder and no deeper.
Example:
C:\FPC\SDL\
While Logger was located in:
C:\FPC\SDL\Pas\
2)I took all PAS files and put them under one dir and
deleted all of SDL uneeded stuff(examples etc)
3)Now it found Logger(I wonder why since it couldnt be found at the beggining)
*Solved:Target was incorrect,sorry for this.
4)I set target to Win32,now try to run Balls.pp,and the teplate.pp.
Got these error on both:

Balls.pp(Using Normal Logger.PAS)
Error:Indentifier Not Found "Class"
Fatal:You need either-S2 or -Sd mode to copile this module.
Either i set parameters(via Run->Parameters)to -s2 or sd,none worked.

Ball.pp (with S2DLLoger.PAS)
Same as above.

S2DL Template.pp(With and without mofified logger.pas/s2dllogger.pas)
Same stuff as above.

What could be wrong?

Anonymous
16-01-2005, 09:41 PM
OK,i found and solved some of the problems.
1)I enabled Verbose mode and saw the errors.
While it was search for Logger.PAS,it was searching anly root folder and no deeper.
Example:
C:\FPC\SDL\
While Logger was located in:
C:\FPC\SDL\Pas\
2)I took all PAS files and put them under one dir and
deleted all of SDL uneeded stuff(examples etc)
3)Now it found Logger(I wonder why since it couldnt be found at the beggining)
*Solved:Target was incorrect,sorry for this.
4)I set target to Win32,now try to run Balls.pp,and the teplate.pp.
Got these error on both:

Balls.pp(Using Normal Logger.PAS)
Error:Indentifier Not Found "Class"
Fatal:You need either-S2 or -Sd mode to copile this module.
Either i set parameters(via Run->Parameters)to -s2 or sd,none worked.

Ball.pp (with S2DLLoger.PAS)
Same as above.

S2DL Template.pp(With and without mofified logger.pas/s2dllogger.pas)
Same stuff as above.

What could be wrong?

First, the path problem, next time do

-Fuc:\SDL\*

The * will make FPC recurse directories.

Second, one can't make the error message more clear than that. The code you are trying to compile is written for Delphi and Kylix, and needs delphi mode (-Sd) enabled. (or -Sd on a line in fpc.cfg, or {$mode delphi} in all sources)

Keep in mind that in a virgin FPC install defaults to turbo pascal mode, not Delphi.

cairnswm
17-01-2005, 07:11 AM
I'm not quite sure how tyo help you here but when I compile Balls.dpr (or Balls.pp) if you have it called that it should also include a Balls.lpi file. In the LPI file are the seetings being used to compile with.

Go into project - Compile Options and click on Show Options: You should have something like:

-S2cdgi -CD -OG1 -gl -XD -vewnhi -l -FuD:\lazarus\JEDI-SDL\ -FuD:\lazarus\S2DL\ -Fu. -FE..\..\compile\ -oD:\lazarus\S2DL\compile\balls.exe

my JEDI-SDL code (all .pas files for JEDI-SDL is D:\lazarus\JEDI-SDL\ (Note the trailing slash)
my S2DL code is in D:\lazarus\S2DL\
I ouput into a seperate compile directory.

See if your options show the same thing and try get it set up in a similar manner.

EmbranceII
17-01-2005, 05:59 PM
I mentioned that i tired both -Sd and -S2 parameters....
I just dont get it...
Tried all modes,Target is correct,then whats going on?

savage
17-01-2005, 06:45 PM
Embrance, can you post the exact command line command you are using with all parameters etc.

Probably an obvious question, is SDL installed on your machine? Are the DLLs somewhere in your exe's path? system32 folder for instance?

EmbranceII
17-01-2005, 07:50 PM
I have all SDL related stuff & DLLs.
What do you mean command line?
If you mean parameters,i enter parameteres this way:
Run->Parameters.
here i have tried both -Sd and -S2 parameters and none worked.

savage
17-01-2005, 08:07 PM
Ok so you are using the Lazarus IDE. Have you tried just using the FreePascal compiler via the command line to make sure that at least that works and compiles your application?

Almindor
17-01-2005, 10:17 PM
I wrote a guide for SDL and FPC. You can read it at:
http://www.freepascal.org/wiki/index.php/FPC_and_SDL

I recommend you copy(if you didn't do it yet) all the SDL sources (and includes) to one directory within your project(EG: basesdl)

Make sure you fill the -Fu and -Fi paths correctly:

In lazarus:
Project/Compiler Options/Other Unit Files(-Fu)
Project/Compiler Options/Include Files(-Fi)

They should both contain "basesdl"

Try to make a simple SDL test app and see if it works.

cairnswm
18-01-2005, 04:54 AM
The parameters entered in the Run | parameters box are parameters that get passed to the prtogram when it runs NOT the compiler.

To change compiler parameters you need to go to Project | Compiler Options and check the relevant boxes.

EmbranceII
18-01-2005, 08:16 PM
Im NOT using Lazarus...Only FPC.
Also i tired to compile the test app in the FPC Wiki,and it seems to be OK(no errors,a window opens and quickly closes)

cairnswm
19-01-2005, 04:58 AM
What did you mean by:


If you mean parameters,i enter parameteres this way:
Run->Parameters.

I understood from that you were using lazarus.

If you are using FPC only you should be compiling from the command line:

C:\FreePascal\Bin\ppc386.exe ......

Now you should be able to set up the rest of the paths you need from here. I have created a batch file to recompile my balls game as follows:


d&#58;\lazarus\pp\bin\win32\fpc -S2cdgi -CD -OG1 -gl -XD -vewnhi -l -FuD&#58;\lazarus\S2DL\ -FuD&#58;\Lararus\JEDI-SDL\ -Fu. -oD&#58;\lazarus\S2DL\demos\Balls\balls.exe D&#58;\lazarus\S2DL\demos\Balls\balls.pp >Compile.txt


(All on one line) (Note my FPC version is the one that comes with Lazarus but if you change the location of the fpc.exe {or ppc386.exe} you should be able to get it working) (Mine is stored in a .bat file as the only line in the file so that I can execute it from the windows explorer)


Also - based on the fact that you say you are not using Lazarus but seem to have menu options etc - you must be using the dos styles editor that comes with FreePascal. I never got it working very well and really feel that if you moved to Lazarus you would be doing yourself a favor. FreePascal itself is not an IDE. FreePascal is only a compiler that an IDE would use to compile Pascal code. Lazarus is an example of an IDE that uses FreePascal as the IDE.

me again...
19-01-2005, 05:27 AM
When i ment Run->Parameters,i mean via the DOS menu of fp.exe...(it has a minimalistic DOS GUI)

cairnswm
19-01-2005, 06:08 AM
Did you try the command line option - if so what errros did you get (copy from the screen so that we can see the actual errors please)

UU.NT1.5567318
19-01-2005, 06:03 PM
OK,i will try to DL Lazarus latest version.Then try to run it from there.I will post later the result.

cairnswm
20-01-2005, 04:36 AM
Try use the FPC command line before using lazarus. By using the command line compiler we can see what errors you are getting more easily than with lazarus.

EmbranceIII
20-01-2005, 05:38 PM
The commands line FPC(ppc386.exe) shows just some info..How to use it to compile something?

cairnswm
20-01-2005, 05:47 PM
What I do is I create a batch file in the project directory - e.g. Balls.bat

Inside the file I put a command similar to the following:


d:\lazarus\pp\bin\win32\ppc386 -S2cdgi -CD -OG1 -gl -XD -vewnhi -l -FuD:\lazarus\S2DL\ -FuD:\Lararus\JEDI-SDL\ -Fu. -oD:\lazarus\S2DL\demos\Balls\balls.exe D:\lazarus\S2DL\demos\Balls\balls.pp >Compile.txt

You should change the relevant directories to suit your installation.

When I double click the batch file in the windows explorer it compiles the project for me.

EmbranceII
20-01-2005, 10:12 PM
I used this a BAT file:

C:\FPC\bin\i386-win32\ppc386 -S2 -FuC:\FPC\units\S2DL\ -FuC:\FPC\units\SDL\ -Fu. -oC:\FPC\units\S2DL\Balls\balls.exe C:\FPC\units\S2DL\Balls\balls.pp >Compile.txt


but every time ppc386.exe cruched and eoor reported...

cairnswm
21-01-2005, 06:01 AM
OK. I created a batch file just like yours:



H:\CairnsGames\fpc\bin\win32\ppc386 -S2 -FuH:\CairnsGames\Games\S2DL\S2DL\ -FuH:\CairnsGames\JEDI-SDL\ -Fu. -oH:\CairnsGames\Games\S2DL\S2DL\Balls\balls.exe H:\CairnsGames\Games\S2DL\S2DL\Balls\balls.pp >Compile.txt


The resultant output (As stored in compile.txt) was:


Hint: End of reading config file h:\cairnsgames\fpc\bin\win32\fpc.cfg
Free Pascal Compiler version 1.0.10 [2003/06/27] for i386
Copyright (c) 1993-2003 by Florian Klaempfl
Target OS: Win32 for i386
Compiling h:\cairnsgames\games\s2dl\s2dl\balls\balls.pp
syswin32.pp(3,1) Hint: Conditional I386 was set at startup in last compilation of syswin32.pp
Compiling h:\cairnsgames\games\s2dl\s2dl\logger.pas
logger.pas(67,10) Fatal: Can't find unit CLASSES


The error is clearly it cannot find unit CLASSES. :( This would indicate to me that something is incorrect in the paths used by FPC and should therefore be added to my list of directories to search for. After investigation classes.pp is in directory: H:\CairnsGames\fpc\source\fcl\win32

so we add it to the batch file



H:\CairnsGames\fpc\bin\win32\ppc386 -S2 -FuH:\CairnsGames\fpc\source\fcl\win32\ -FuH:\CairnsGames\Games\S2DL\S2DL\ -FuH:\CairnsGames\JEDI-SDL\ -Fu. -oH:\CairnsGames\Games\S2DL\S2DL\Balls\balls.exe H:\CairnsGames\Games\S2DL\S2DL\Balls\balls.pp >Compile.txt

Again an error :( - classesh.inc - found in H:\CairnsGames\fpc\source\fcl\inc - add to batch file: (Note this is an include!



H:\CairnsGames\fpc\bin\win32\ppc386 -S2 -FuH:\CairnsGames\fpc\source\fcl\win32\ -FiH:\CairnsGames\fpc\source\fcl\inc\ -FuH:\CairnsGames\Games\S2DL\S2DL\ -FuH:\CairnsGames\JEDI-SDL\ -Fu. -oH:\CairnsGames\Games\S2DL\S2DL\Balls\balls.exe H:\CairnsGames\Games\S2DL\S2DL\Balls\balls.pp >Compile.txt

Again an error :( - do same thing:





Now when I compile I get the following error: (right at the end of the compile.txt file).



Compiling s2dldraws.pp
s2dldraws.pp(91,22) Error: Illegal qualifier
s2dldraws.pp(91,22) Hint: Maybe pointer dereference is missing
s2dldraws.pp(91,22) Fatal: Syntax error, ; expected but identifier W found


Now in reality I am a Delphi Developer - not a freepascal developer. This means I often use Delphi standards and not the normal freepascal stuff.

You will notice that S2DL v1.04 will have Delphi Mode included in all files when released. When D2DL 1.0 and 1.02 were release I didn't know how to do this, so you need to set delphi mode when compiling - thats the -S2d switch in the following batch file:



H:\CairnsGames\fpc\bin\win32\ppc386 -S2d -FuH:\CairnsGames\fpc\source\fcl\win32\ -FiH:\CairnsGames\fpc\source\fcl\inc\ -FiH:\CairnsGames\fpc\source\fcl\win32\ -FuH:\CairnsGames\Games\S2DL\S2DL\ -FuH:\CairnsGames\JEDI-SDL\ -Fu. -oH:\CairnsGames\Games\S2DL\S2DL\Balls\balls.exe H:\CairnsGames\Games\S2DL\S2DL\Balls\balls.pp >Compile.txt

After all that it compiles just fine. :)

I hope that following this you can get it compiled. :)

I had to do this whole process because you did not indicate what error you were recieving. When asking for help please could you include all information you have. In this case the batch file you were using as well as the full output (or errors only if too long) of the compile.txt file would have helped. If you were not using S2DL I probably would have ignored this post.

EmbranceII
21-01-2005, 05:41 PM
I posted my batch file just before you did.
Also how can i show you the errors,while ppc386 crashes??
I will try it the way you did it and post results later.

cairnswm
21-01-2005, 05:52 PM
If it crashes it gives an error - we need to see that error to understand why it crashes. then we can help. If FPC is crashing as in an Acess Violation then I suggest you take it to the FreePascal foruns at www.freepascal.org as they should be able to help you.

We try our best to help here but we need enough information to be able to help.

EmbranceIII
21-01-2005, 09:31 PM
its an access violation error..I will post at FPC community to see what the prob could be....