* removed "evalutation version" remark in the readme.txt

* new faq.htm and faq.txt
This commit is contained in:
Jonas Maebe 2000-07-10 12:38:00 +00:00
parent 8dcd4fc669
commit c46d0ad3d0
3 changed files with 703 additions and 791 deletions

View File

@ -1,31 +1,23 @@
<html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Author" CONTENT="Free Pascal Web Team">
<META name="description" content="Free Pascal: free 32-bit Pascal compiler for DOS, Linux, Win32 and OS/2">
<META NAME="keywords" content="32 bit, protected mode, compiler, pascal, FPC, FPC Pascal, Free Pascal">
<TITLE>Free Pascal - Online documentation</TITLE>
<TITLE>Free Pascal - FAQ</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFCC99" LINK="#0000EE" VLINK="#551A8B"
ALINK="#FF8080"><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
<center><h1> FreePascal FAQ</h1>
<h3>As distributed with FPC 0.99.14</center></h3><p>
<b>This FAQ might not be up to date. See <a href="http://www.freepascal.org/faq.html">the FPC FAQ on internet</a> for updates.</b><p>
This FAQ is in no way a substitute for the extensive documentation that accompanies FPC.<p>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF8080">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
<OL>
<!-- IDXSTART -->
<LI><A HREF="#WhatIsFP">What is Free Pascal (FPC)?</A></LI>
<LI><A HREF="#versions">Which versions exist, and which one should I use?</A></LI>
<LI><A HREF="#KnownBugs">Known bugs</A></LI>
<LI><A HREF="#FPandGNUPascal">Free Pascal and GNU Pascal - a comparison</A></LI>
<LI><A HREF="#WhereToGetFP">Where can I get the compiler?</A></LI>
<LI><A HREF="#PortabilityTips">What are the considerations in porting</A></LI>
<LI><A HREF="#OOP">I tried to compile my Delphi code with the Free Pascal Compiler,</A></LI>
<LI><A HREF="#OOP">I tried to compile my Delphi code with the Free Pascal</A></LI>
<LI><A HREF="#HOMEWORK">I have to write a program for homework. Can you help?</A></LI>
<LI><A HREF="#HowcanIbuildaunit">How can I build a unit?</A></LI>
<LI><A HREF="#TurboVision">Will Free Pascal support TV (Turbo Vision) in the future?</A></LI>
@ -36,202 +28,166 @@ This FAQ is in no way a substitute for the extensive documentation that accompan
<LI><A HREF="#DJGPP2support">When will Free Pascal use DJGPP 2.0 under DOS/Windows?</A></LI>
<LI><A HREF="#HowToUseGraph">How can I use the graph unit with Free Pascal?</A></LI>
<LI><A HREF="#IntegratedAssemblerSyntax">Integrated Assembler syntax</A></LI>
<LI><A HREF="#HowToAccessDosMemory">How to access DOS memory / How to do graphics ?</A></LI>
<LI><A HREF="#FPwithoutfpu">Free Pascal without a math coprocessor</A></LI>
<LI><A HREF="#AccessingMoreThan4MB">Accessing more than 4 megabytes</A></LI>
<LI><A HREF="#accessioports">Access I/O ports</A></LI>
<LI><A HREF="#HowToAccessDosMemory">How can I access DOS memory / How can I do graphics programming?</A></LI>
<LI><A HREF="#FPwithoutfpu">How can I run Free Pascal without a math coprocessor?</A></LI>
<LI><A HREF="#AccessingMoreThan4MB">How do I reserve more than 2 megabytes of RAM?</A></LI>
<LI><A HREF="#accessioports">How can I access I/O ports?</A></LI>
<LI><A HREF="#ImusingWin95">I'm using the Dos compiler under Windows 95</A></LI>
<LI><A HREF="#ImusingOS2">I'm using OS/2</A></LI>
<LI><A HREF="#dpmi">INSTALL.EXE of Dos version 0.99.10 reports "Load error: no DPMI"</A></LI>
<LI><A HREF="#winnt">INSTALL.EXE of Dos version 0.99.10 does not run in Windows NT</A></LI>
<LI><A HREF="#snapshot">I want a new version NOW</A></LI>
<LI><A HREF="#ideinst">Where can I find a text mode IDE for Dos</A></LI>
<LI><A HREF="#ideconfig">How do I configure the Dos IDE</A></LI>
<LI><A HREF="#ideinst">Where can I find a text mode IDE?</A></LI>
<LI><A HREF="#ideconfig">How do I configure the IDE?</A></LI>
<LI><A HREF="#binariesbig">Why are the generated binaries so big?</A></LI>
<LI><A HREF="#systemnotfound">Unit system, syslinux or syswin32 not found errors</A></LI>
<LI><A HREF="#systemnotfound">Unit system, syslinux, sysos2 or syswin32 not found errors</A></LI>
<LI><A HREF="#KnownBugs">Known bugs</A></LI>
<LI><A HREF="#ErrorPos">How can I find where an error occurred using the addresses a crashed program prints?</A></LI>
<!-- IDXEND -->
</OL>
<OL>
<A NAME="WhatIsFP"></A>
<H3><LI>What is Free Pascal(FPC) ?</LI></H3>
<LI><A NAME="WhatIsFP"></A><H3>What is Free Pascal (FPC)?</H3>
<P>
Originally named FPK-Pascal, the Free Pascal compiler is a 32 bit Turbo
Pascal compatible Pascal compiler for DOS, Linux, Win32, OS/2 and (based on
an older version) the AmigaOS.
More Operating systems are in the works. <BR>
The compiler is written in Pascal and is able to compile its own sources.
The source files are included. <BR>
Free Pascal requires a fast computer to run efficiently (386-25 Mhz for
the Intel version and ideally a 68020 processor for the Motorola
version). At least 2 megabytes of RAM is required. To remake the compiler
more than 16 is recommended.
an older version) the AmigaOS. More operating systems are in the works.
</P>
<P>Short history: <BR>
<B>&nbsp;6/1993</B> project start <BR>
<B>10/1993</B> first little programs work <BR>
<B>&nbsp;3/1995</B> the compiler compiles the own sources <BR>
<B>&nbsp;3/1996</B> released to the internet<br>
<B>&nbsp;probably 2000</b> 1.0 version
</P>
<A NAME="versions"></A>
<H3><LI>Which versions exist, and which one should I use?</LI></H3>
<p>
Compilers with an <b>even</b> last number are <b>release</b> versions(e.g. 0.99.8, 0.99.10, 0.99.12 and 0.99.14)<br>
Compilers and packages with an <b>odd</b> last number are <b>development</b> versions (e.g. 0.99.9, 0.99.11, 0.99.13 and 0.99.15).<p>
0.99.5 is an exception to this rule, since <b>0.99.5 IS a release</b> (a release prior to the introduction of this odd/even system)<p>
Letters behind the version number (0.99.12b, 0.99.5d) indicate release versions with some
bugs and problems in the original release (respectively 0.99.12 and 0.99.5) fixed.<p>
Normally you would want to use a release. Releases are considered stable, and
easier to support. (the bugs, quirks and unintended &quot;features&quot; are wellknown after a period of time,
and workarounds exist).<p>
Development snapshots which are generated daily reflect the current status of the compiler.
Development versions probably have new features and larger bugs fixed since the last release,
but might have some temporary stability drawbacks, (btw which are usually fixed quite soon)<p>
Most support for development snapshots are basically the advise to
upgrading to newer snapshot in which the bugs are hopefully fixed.<p>
Since version 0.99.8 the stability of the compiler steadily increased, and development
snapshots are often quite useful for certain categories of users. Ask in the maillists
if it is worth the effort in your case.<p>
<br>
The current release version is 0.99.14 for the OS/2,Linux,Windows and Dos (Go32V2) targets,<br>
and 0.99.5d for the 680x0 based systems (mainly Amiga and Mac)<p>
The current development snapshot version is 0.99.13 or 0.99.15.<p>
</P>
<A NAME="KnownBugs"></A>
<H3><LI>Known bugs</LI></H3>
<P>
Go to the <A HREF="http://www.freepascal.org/bugs.html">bugs page</A>
The compiler is written in Pascal and is able to compile its own sources.
The source files are included.
</P>
<A NAME="FPandGNUPascal"></A>
<H3><LI>Free Pascal and GNU Pascal - a comparison</LI></H3>
<P>
Free Pascal is modest regarding its minimal system requirements (386-25 Mhz for
the Intel version and ideally a 68020 processor for the Motorola
version). At least 2 megabytes of RAM are required. To remake the compiler
more than 16MB is recommended.
</P>
Short history:
<UL>
<LI>6/1993: project start
<LI>10/1993: first little programs work
<LI>3/1995: the compiler compiles the own sources
<LI>3/1996: released to the internet
<LI>7/2000: 1.0 version
</UL><BR>
<LI><A NAME="versions"></A><H3>Which versions exist, and which one should I use?</H3>
<P>
Compilers with an <b>even</b> last number are <b>release</b> versions(e.g. 0.99.8, 0.99.10, 0.99.12, 0.99.14 and 1.00)<br>
Compilers and packages with an <b>odd</b> last number are <b>development</b> versions (e.g. 0.99.9, 0.99.11, 0.99.13, 0.99.15 and 1.0.9).
</P>
<P>
0.99.5 is an exception to this rule, since <b>0.99.5 IS a release</b> (a release prior to the introduction of this odd/even system)
</P>
<P>
Letters behind the version number (0.99.12b, 0.99.5d) indicate release versions with some bugs and problems in the original release (respectively 0.99.12 and 0.99.5) fixed.
</P>
<P>
Normally you would want to use a release. Releases are considered stable, and
easier to support (the bugs, quirks and unintended &quot;features&quot; are well
known after a period of time,
and workarounds exist).
</P>
<P>
Development snapshots (which are generated daily) reflect the current status of the compiler.
Development versions probably have new features and larger bugs fixed since the last release,
but might have some temporary stability drawbacks (which are usually fixed by the
next day)
</P>
<P>
Most support for development snapshots are basically the advise to
upgrade to newer snapshot in which the bugs are hopefully fixed.
Since version 0.99.8 the stability of the compiler steadily increased
and development
snapshots are often quite useful for certain categories of users. Ask in the maillists if it is worth the trouble in your case if you're not sure.
</P>
<P>
The current release version is 1.00 for the OS/2, Linux, Windows and Dos (Go32V2) targets and 0.99.5d for the 680x0 based systems (Amiga and Atari ST)
</P>
<P>
The current development snapshot version is 1.0.9.
</P>
<LI><A NAME="FPandGNUPascal"></A><H3>Free Pascal and GNU Pascal - a comparison</H3>
<DL>
<DT><B>aim:</B></DT>
<DT><B>Aim:</B></DT>
<DD>Free Pascal tries to implement a Borland compatible pascal compiler
on as many platforms as possible. GNU Pascal tries to implement a portable
pascal compiler based on POSIX.</DD>
<DT><B>Version:</B></DT>
<DD>Currently, Free Pascal is at version 0.99.12 for the Intel version,
and version 1.0 will be out soon,
<DD>Currently, Free Pascal is at version 1.00 for the Intel version
and version 0.99.5d for the Motorola/Intel version. Version 0.99.5d differs
from version 0.99.5 in that all run time library fixes have been
applied, as well as all known code generation bugs. Version 0.99.12
differs from version 0.99.5c in that all parser bugfixes have also
applied, as well as all known code generation bugs. Version 1.00
differs from version 0.99.5d in that all parser bugfixes have also
been applied and also a lot of Delphi 2 and Delphi 3 extensions have
been implemented. GNU Pascal is at version 2.7.2 (but this numbering is
been implemented. GNU Pascal is at version 2.8.1 (but this numbering is
not really an indication, it follows the GNU
C numbering, since it is a derivation of it)</DD>
<DT><B>Operating systems:</B></DT>
<DD>Free pascal runs on a limited number of systems : DOS, Win32, Linux,
OS/2 and AmigaOS and is for the moment limited to the Intel and Motorola
architectures. GNU Pascal runs basically on any system that can run GNU C.
</DD>
<DT><B>Sources:</B></DT>
<DD>Free Pascal is entirely written in Pascal (about 4 Mb of source code),
while GNU Pascal is written in C (it's an adaptation of the GNU C compiler
: 2.8 Mb code + 8 MB of GNU C code)</DD>
while GNU Pascal is written in C (it's an adaptation of the GNU C compiler:
2.8 Mb code + 8 MB of GNU C code)</DD>
<DT><B>Language:</B></DT>
<DD>Free Pascal supports the Borland Pascal dialect Borland, and implements
the Delphi Object PAscal language. GNU Pascal supports ISO 7185, ISO 10206,
the Delphi Object Pascal language. GNU Pascal supports ISO 7185, ISO 10206,
(most of) Borland Pascal 7.0</DD>
<DT><B>Extensions:</B></DT>
<DD>Free Pascal implements function overloading, and operator overloading).
<DD>Free Pascal implements function overloading and operator overloading.
GNU Pascal implements operator overloading.</DD>
<DT><B>License:</B></DT>
<DD>Both compilers come under the GNU GPL.</DD>
<DT><B>Author:</B></DT>
<DD>Free Pascal was started by Florian Klaempfl, Germany (klaempfl@haegar.cip.mw.tu-muenchen.de),
GNU Pascal was started by Jukka Virtanen, Finland, (jtv@hut.fi).</DD>
<DD>Free Pascal was started by Florian Klaempfl, Germany (Florian.Klaempfl@gmx.de),
GNU Pascal was started by Jukka Virtanen, Finland (jtv@hut.fi).</DD>
</DL>
<A NAME="WhereToGetFP"></A>
<H3><LI>Where can I get the compiler ?</LI></H3>
<BR>
<LI><A NAME="WhereToGetFP"></A><H3>Where can I get the compiler ?</H3>
<P>
Free Pascal is available for download from all <A HREF="http://www.freepascal.org/download.html"> official mirrors</A>
Free Pascal is available for download from all <A HREF="download.html"> official mirrors</A>
</P>
<A NAME="PortabilityTips"></A>
<H3><LI>What are the considerations in porting
code to other processors?</A></H3>
<LI><A NAME="PortabilityTips"></A><H3>What are the considerations in porting
code to other processors?</H3>
<P>
Because the compiler now supports processors other than the Intel, it is
important to take a few precautions so that your code will execute
correctly on all processors.
</P>
<UL>
<LI> Limit your use of asm statements unless it is time critical code</LI>
<LI>Limit your use of asm statements unless it is time critical code
<LI>Don't use the packed directive unless you know exactly what you are
doing. Most processors require alignment of data, and using packed on
objects,classes and records may break this requirement. If this is the
case your code will simply crash on the target processors.</LI>
<LI> Clean up at the end of your program, i.e close all files on exit,
as some operating systems don't like it when some files are left opened. </LI>
case your code will simply crash on the target processors.
<LI>Clean up at the end of your program, i.e. close all files on exit,
as some operating systems don't like it when some files are left opened.
<LI>Try not to rely on the endian of the specific machines when doing
arithmetic operations. Furthermore, reading and writing of binary data
to/from files will probably require byte swaps across different endian
machines (swap is your friend in this case) </LI>
machines (swap is your friend in this case)
<LI>Try limiting your local variables in subroutines to 32K, as this
is the limit of some processors, use dynamic allocation instead. </LI>
is the limit of some processors, use dynamic allocation instead.
<LI>Try limiting the size of parameters passed to subroutines to 32K,
as this is the limit of some processors, use const or var parameters
instead. </LI>
</UL>
</P>
<A NAME="OOP"></A>
<H3><LI>I tried to compile my Delphi code with the Free Pascal Compiler,
it seems that it doesn't recognize the OOP.</LI></H3>
instead.
</UL><BR>
<LI><A NAME="OOP"></A><H3>I tried to compile my Delphi code with the Free Pascal
Compiler, but it seems that it doesn't recognize Delphi style OOP.</H3>
<P>
The compiler supports the Delphi OOP. There may be some bugs, of course,
You should try the -S2, -Sd or -So switches (see the manuals for the
meaning of these switches)
The compiler supports the Delphi OOP. Make sure you use
the -S2 or -Sd switches (see the manuals for the meaning of these switches).
</P>
<A NAME="HOMEWORK"></A>
<H3><LI>I have to write a program for homework. Can you help?</LI></H3>
<LI><A NAME="HOMEWORK"></A><H3>I have to write a program for homework. Can you help?</H3>
<P>
No. Please, don't send us mail about homework, we are no teachers.
The Free Pascal development team tries to give good support for the Free
Pascal compiler and are trying to always reply to emails. If we get
emails like this, this becomes harder and harder.
</P>
<A NAME="HowcanIbuildaunit"></A>
<H3><LI>How can I build a unit?</LI></H3>
<LI><A NAME="HowcanIbuildaunit"></A><H3>How can I build a unit?</H3>
<P>
It works like in Turbo Pascal. The first keyword in the file must be
UNIT (not case sensitive). The compiler will generate two files: <TT>XXX.PPU</TT>
@ -240,20 +196,14 @@ instead. </LI>
structure depends on the assembler you used). To use this unit in another
unit or program, you must include its name in the USES clause of your program.
</P>
<A NAME="TurboVision"></A>
<H3><LI>Will Free Pascal support TV (Turbo Vision) in the future?</LI></H3>
<LI><A NAME="TurboVision"></A><H3>Will Free Pascal support TV (Turbo Vision) in the future?</H3>
<P>
A Turbo Vision port, called Free Vision, has progressed nicely lately. It's
already very usable, we are even writing an IDE in it. Due to copyrights
problem the FreeVision source code is not available at the moment. You can
download the IDE from the <a href="http://www.freepascal.org/develop.html#snapshot">development</a> page. and get an idea of the look and feel though.
download the IDE from the <A HREF="develop.html#snapshot">development</A> page. and get an idea of the look and feel though.
</P>
<A NAME="CompileSystemUnit"></A>
<H3><LI>How can I compile the system unit ?</LI></H3>
<LI><A NAME="CompileSystemUnit"></A><H3>How can I compile the system unit?</H3>
<P>
To recompile the system unit, it is recommended to have GNU make installed.
typing 'make' in the rtl source directory will then recompile all RTL units
@ -265,43 +215,34 @@ instead. </LI>
It is possible to do all this manually, but you need more detailed knowledge
of the RTL tree structure for that.
</P>
<A NAME="Internalerror9999"></A>
<H3><LI>I get an internal error 9999</LI></H3>
<LI><A NAME="Internalerror9999"></A><H3>I get an internal error 9999</H3>
<P>
The latest versions of the Free Pascal Compiler come with an error handling
routine which catches the segmentation fault and lets the compiler to exit
gracefully. This is reported as an internal error 9999.
Please try to reproduce the error and send <A HREF="bugs.html">us</A>
a bug report.
</P>
<P>
The latest versions of the Free Pascal Compiler come with a Error Handling
routine which catches the segmentation fault, and lets the compiler exit
gracefully. This is reported as an internal error 9999. <BR>
Please try to reproduce the error and send <A HREF="http://www.freepascal.org/moreinfo.html">us</A>
a bug report.<p>
(For the curious, IE 9999 is not a specific bug. It is a safety measure which
terminates if during compiling a certain condition is not met, which can be
caused by several bugs. So if you report the bug, and get IE 9999 later in
a different piece or part of sourcecode, it could be a completely different
bug)
bug.)
</P>
<A NAME="Howdoesfunctionoverloadingwork"></A>
<H3><LI>How does function overloading work?</LI></H3>
<LI><A NAME="Howdoesfunctionoverloadingwork"></A><H3>How does function overloading work?</H3>
<P>
function overloading is implemented, like in C++:
</P>
<PRE>
procedure a(i : integer);
begin
end;
procedure a(s : string);
begin
end;
begin
a('asdfdasf&quot;);
a('asdfdasf');
a(1234);
end.
</PRE>
@ -312,10 +253,7 @@ instead. </LI>
function can't be local' message. Overloaded functions must differ in their
parameters, it's not enough if their return types are different.
</P>
<A NAME="HowToCallCFuncuntions"></A>
<H3><LI>How can I call C functions ?</LI></H3>
<LI><A NAME="HowToCallCFuncuntions"></A><H3>How can I call C functions?</H3>
<P>
C calling convention is implemented as follows: The compiler pushes
the parameters from right to left, but the procedure has to clear the stack.
@ -325,27 +263,19 @@ instead. </LI>
function strcmp(s1 : pchar;s2 : pchar) : integer;cdecl;external;
Since 0.99.5, the older [C]; won't work!
</PRE>
<A NAME="DJGPP2support"></A>
<H3><LI>When will Free Pascal use DJGPP 2.0 under DOS/Windows ?</LI></H3>
<LI><A NAME="DJGPP2support"></A><H3>When will Free Pascal use DJGPP 2.0 under DOS/Windows?</H3>
<P>
As of version 0.99.0 Free Pascal uses DJGPP 2.0. DJGPP v1.2 support has
been removed since version FPC 0.99.8.
</P>
<A NAME="HowToUseGraph"></A>
<H3><LI>How can I use the graph unit with Free Pascal ?</LI></H3>
<LI><A NAME="HowToUseGraph"></A><H3>How can I use the graph unit with Free Pascal?</H3>
<P>
Look at InitGraph.
Since 0.99.12, the graph unit is available both for Dos and Linux. Under Dos,
it only supported VESA modes though. Since version 0.99.14, a new more system
independant graph unit is included (although the only extra supported OS is
Win32 and this is only rudimentary support) which also supports standard VGA.
</P>
<!---
If you want to use the GRAPH unit, a VESA 1.2 compliant graphics
card must be installed.
-->
<A NAME="IntegratedAssemblerSyntax"></A>
<H3><LI>Integrated Assembler syntax</LI></H3>
<LI><A NAME="IntegratedAssemblerSyntax"></A><H3>Integrated Assembler syntax</H3>
<P>
The default assembler syntax (AT&amp;T style) is different from the
one in Borland Pascal (Intel style).
@ -357,39 +287,33 @@ instead. </LI>
</P>
<P>
A description of the AT&amp;T syntax can be found in the DJGPP FAQ <A HREF="http://www.delorie.com/djgpp/v2faq/faq102.html#Syntax">http://www.delorie.com/djgpp/v2faq/faq102.html#Syntax</A>
or in Brennan's Guide to Inline Assembly <A HREF="http://www.rt66.com/~brennan/djgpp/djgpp_asm.html">http://www.rt66.com/~brennan/djgpp/djgpp_asm.html</A>.
or in Brennan's Guide to Inline Assembly <A HREF="http://www.rt66.com/%7Ebrennan/djgpp/djgpp&nbsp;asm.html">http://www.rt66.com/%7Ebrennan/djgpp/djgpp&nbsp;asm.html</A>.
The documentation also contains a chapter where the difference between
the Intel and AT&amp;T style assembly is explained.
</P>
<P>
Or you can use the convertor program at http://rcs.urz.tu-dresden.de/
schoenfu/zip/asmtrans.zip.
Or you can use the convertor program at <A HREF="http://rcs.urz.tu-dresden.de/schoenfu/zip/asmtrans.zip">http://rcs.urz.tu-dresden.de/schoenfu/zip/asmtrans.zip
</A>.
</P>
<A NAME="HowToAccessDosMemory"></A>
<H3><LI>How to access DOS memory / How to do graphics ?</LI></H3>
<LI><A NAME="HowToAccessDosMemory"></A><H3>How can I access DOS memory / How can I do graphics programming?</H3>
<P>
You can do like in TP, via absolute or mem, for larger blocks use the
dosmemput/dosmemget routines in unit Go32
You can do like in TP, via absolute or mem[]. For larger memory blocks use the
dosmemput/dosmemget routines in Go32 unit.
</P>
<A NAME="FPwithoutfpu"></A>
<H3><LI>Free Pascal without a math coprocessor</LI></H3>
<LI><A NAME="FPwithoutfpu"></A><H3>How can I run Free Pascal without a math coprocessor?</H3>
<P>
On the Intel version the emulator is automatically loaded by the compiler,
the file is bin\emu387.
On the Intel version the emulator is automatically loaded by the compiler
if you add the following commands to your autoexec.bat:
</P>
<PRE>
SET GO32=EMU C:\PP\BIN\EMU387
SET 387=N
SET EMU386=C:\PP\BIN\GO32V2\WEMU387.DXE
</PRE>
<A NAME="AccessingMoreThan4MB"></A>
<H3><LI>Accessing more than 4 megabytes</LI></H3>
(don't forget to replace the <TT>C:\PP</TT> with the directory where you installed FPC)
<LI><A NAME="AccessingMoreThan4MB"></A><H3>How do I reserve more than 2 megabytes of RAM?</H3>
<P>
By default Free Pascal allocates only 4 meg. If it just allocated all
it could get, people running windows would have problems as Windows would
By default Free Pascal allocates only 2MB of RAM for your application. If it just allocated all
it could get, people running Windows would have problems as Windows would
increase the swap file size to give the program more memory on and on,
until the swap file drive would be full.
</P>
@ -398,27 +322,27 @@ the file is bin\emu387.
is -Ch4000000. Try -Ch10000000, provided you got enough swap space.
</P>
<P>
However, the heap size doesn't really matter anymore, since the Heap
is able to grow. That is, if you've used all available heap space, the
program will try to get more memory from the OS, thus the heap is limited
is able to grow: if you've used all the available heap space, the
program will try to get more memory from the OS, so the heap is limited
to the maximum amount of free memory provided by the OS.
</P>
<A NAME="accessioports"></A>
<H3><LI>Access I/O ports</LI></H3>
<P>
If you're under DOS, you should use the <TT>outport*</TT> and <TT>inport*</TT>
It is only handy if you know you will need at least a certain amount of memory.
You can then specify this value using the -Ch parameter, so your program will
allocate it at once on startup. This is slightly faster than growing the heap
a number of times.
</P>
<LI><A NAME="accessioports"></A><H3>How can I access I/O ports?</H3>
<P>
With versions before 0.99.10: if you're under DOS you can use the <TT>outport*</TT> and <TT>inport*</TT>
procedures of the go32 unit.
</P>
<P>
Since version 0.99.8, the Port array is supported like in TP, as long as you
use the ports unit in your program.
use the ports unit in your program (not available under Win32).
</P>
<A NAME="ImusingWin95"></A>
<H3><LI>I'm using the Dos compiler under Windows 95</LI></H3>
<LI><A NAME="ImusingWin95"></A><H3>I'm using the Dos compiler under Windows 95</H3>
<P>
There is a problem with the Dos compiler and Win 95 on computers with less
than 16 MB. First set in the properties of the DOS box the DPMI memory
@ -427,165 +351,200 @@ the file is bin\emu387.
the compiler to work by recompiling it with a smaller heap size, perhaps
2 or 4 MB (option -Chxxxx).
</P>
<A NAME="ImusingOS2"></A>
<H3><LI>I'm using OS/2</LI></H3>
<LI><A NAME="ImusingOS2"></A><H3>I'm using OS/2</H3>
<P>
Problems have been reported that the Go32v2 compiler does not run on
some OS/2 installations. You can use the native OS/2 compiler, or compile
a GO32V1 compiler yourself.
Problems have been reported that the GO32v2 compiler does not run on
some OS/2 installations. You can use the native OS/2 compiler (strongly
preferred solution) or maybe compile a GO32v1 compiler yourself. However,
the GO32v2 version should generally work under OS/2 as well.
</P>
<A NAME="dpmi"></A>
<H3><LI>INSTALL.EXE of Dos version 0.99.10 reports "Load error: no DPMI"</LI></H3>
<LI><A NAME="dpmi"></A><H3>INSTALL.EXE of Dos version 0.99.10 reports "Load error: no DPMI"</H3>
<p>
The file cwsdpmi.exe is missing in the main directory of the zip archive.
The above message pops up of no other DPMI services are available.
The above message pops up if no other DPMI services are available.
Such services are for example available in a Dos window of Windows.
You can either extract that file from basego32.zip or download it from
<a href="http://www.brain.uni-freiburg.de/~klaus/cwsdpmi.exe">
http://www.brain.uni-freiburg.de/~klaus/cwsdpmi.exe</a>.
<a href="http://www.brain.uni-freiburg.de/%7Eklaus/cwsdpmi.exe">
http://www.brain.uni-freiburg.de/%7Eklaus/cwsdpmi.exe</a>.
Put it into the same directory as install.exe and run install again.
</p>
<A NAME="winnt"></A>
<H3><LI>INSTALL.EXE of Dos version 0.99.10 does not run in Windows NT</LI></H3>
<p>
<LI><A NAME="winnt"></A><H3>INSTALL.EXE of Dos version 0.99.10 does not run in Windows NT</H3>
<P>
This is an incompatibility of the mouse driver.
Use this new version of install.exe instead:
<a href="ftp://ftp.freepascal.org/pub/fpc/snapshot/install.exe">
ftp://ftp.freepascal.org/pub/fpc/snapshot/install.exe</a>
</p>
<A NAME="snapshot"></A>
<H3><LI>I want a new version NOW</LI></H3>
<p>
</P>
<LI><A NAME="snapshot"></A><H3>I want a new version NOW</H3>
<P>
In the time between the release of new official versions, you
can have a look at and test developer versions.
can have a look at and test developer versions (so-called "snapshots").
Be warned though: this is work under progress, so in addition to
old bugs fixed and new features added, this may also contain new bugs.
The snapshot is generated automatically each night from the current
source at that moment. Somethimes this may fail due to bigger changes
</P>
<P>
Snapshots are generated automatically each night from the current
source at that moment. Sometimes this may fail due to bigger changes
not yet fully implemented. If your version doesn't work, try again one
or two days later. Don't download the Go32V1 version for Dos, it's not
supported any more.
or two days later. You're advised not to download the GO32v1 version for Dos,
since it's not supported any more.
</p>
<p>The latest snapshot can be downloaded from the
<a href="http://www.freepascal.org/develop.html#snapshot">development</a> web page.
<p>The latest snapshot can always be downloaded from the
<a href="develop.html#snapshot">development</a> web page.
</p>
<p>
To install a snapshot, extract the zip archive into the existing
program directory of the last official version of fee pascal (after
making a backup of the original of course). Or extract it into an
empty directory, then move the files to the program directory,
overwriting existing files. Make sure that you extract the ZIP archiv
such that the included directory structure remains intact, for example
if you use PKUNZIP, use "pkuzip -d" instead of just "pkunzip".
program directory of the last official version of Free Pascal (after
making a backup of the original of course). You can also extract it into an
empty directory and then move the files to the program directory,
overwriting existing files. Make sure that you extract the ZIP archive
such that the included directory structure remains intact. For example
if you use PKUNZIP, use "pkunzip -d" instead of just "pkunzip".
Note that snpashots also contain a new RTL which most likely can't be
used with the previous release version, so backup your old RTL as well.
</p>
<A NAME="ideinst"></A>
<H3><LI>Where can I find a text mode IDE for Dos</LI></H3>
<LI><A NAME="ideinst"></A><H3>Where can I find a text mode IDE?</H3>
<p>
The development of the IDE (integrated development environment)
is not yet finished. However a working test version of the IDE is available
as snapshot. It requires the latest compiler snapshot be installed on
top of the last official Dos version 0.99.12 for Go32V2. So if you
have not already done it, first install the last official
version (file dos09912.zip or dos09912full.zip, you find these in
the <a href="http://www.freepascal.org/download.html">download</a> section).
Then get and extract the latest Dos snapshot for DOS-GO32V2 (snapshot.zip)
into the directory containing the last official version.
Then do the same with one of the IDE snapshots (the debugger does not
work very well yet, so start with the version "IDE with compiler").
top of the current official version for your particular platform (1.00
for GO32v2 or Win32). So if you have not already done that, first install the latest official
version (e.g. file dos100.zip or dos100full.zip, you find these in
the <a href="download.html">download</a> section).
</p>
<p>
Then get and extract the latest snapshot for your platform (e.g. snapshot.zip)
into the directory containing the official version.
Next, do the same with one of the IDE snapshots.
For more details on where to find and how to install a snapshot,
please see the previous FAQ item. For additional instructions
for required IDE configuration please also read the next FAQ item.
</p>
<A NAME="ideconfig"></A>
<H3><LI>How do I configure the Dos IDE</LI></H3>
<LI><A NAME="ideconfig"></A><H3>How do I configure the Dos IDE?</H3>
<p>
Once you have installed the IDE (see the previous FAQ item),
it requires two configuration changes before it can compile.
This is due to the fact that the IDE includes its own compiler,
This is due to the fact that the IDE includes its own compiler;
it does not use ppc386.exe and thus it also does not use the
configuration in the file ppc386.cfg. Thus if you try to compile,
you get an error message telling that it can not compile
the system unit. To fix this start fp.exe, select from the
menu Compile, then Target then Go32V2. Next select the menu
Options/Directories and in the line "Unit directories" enter the path
to your copy of the rtl directory, usually c:\pp\units\go32v2\rtl.
configuration in the file ppc386.cfg.
</p>
<p>
Start fp.exe, select Target from the Compile menu and then check GO32v2.
Next, choose Directories in the Otions menu and in the line "Unit directories"
enter the path to your copy of the rtl directory, usually c:\pp\rtl\go32v2.
If you have done everything correct and it still doesn't work,
you may have grabbed a snapshot that has a bug, in this case
try again one or two days later.
you may have grabbed a snapshot that has a bug; in this case
try again one or two days later or ask for help on one of the
<A HREF="maillist.html">mailing lists</A>.
</p>
<A NAME="binariesbig"></A>
<H3><LI>Why are the generated binaries so big?</LI></H3>
<LI><A NAME="binariesbig"></A><H3>Why are the generated binaries so big?</H3>
<p>
There are several reasons and remedies for this.
There are several reasons and remedies for this:
</p>
<ol>
<li>If you are using 0.99.12: Due to some problems with the binary writer, the 0.99.12 and fixes weren't
released with smartlinking RTLs. Smartlinking causes only actually used procedures,
functions and constants to be linked in.<br>
You can remedy this by using a development version and creating a smartlinking
RTL. See the <a href="http://www.freepascal.org/makecyc.html">make cycle faq</a> or use a later release if available.</li>
<lI>Generating debug code (-g options) is enabled. Use the strip utility
(or stripw for the windows platform) to remove the debuginformation.<br>
The utility is supplied with the releases, except under Linux were it is part
of the GNU binutils package.</li>
<lI>Under Dos(Go32V2) and windows targets you can use UPX to pack the .EXEs (just like e.g. pklite).
The architecture of linux doesn't allow binary packing.</li>
<lI>You can use LXLITE for packing EMX binaries, but you won't be able to run
them under DOS any more then. It might even not be possible to use them
on lower OS/2 versions (like 2.x) depending on chosen type of compression.</li>
<li>Turning on optimalisations, both for supplied packages (RTL,API,FV,FCL) as for
your own code, will also decrease code-size. </li>
</ol>
</p>
<A NAME="systemnotfound"></A>
<H3><LI>Unit system, syslinux or syswin32 not found errors</LI></H3>
<li>
<p>If you are using 0.99.12: Due to some problems with the binary writer, 0.99.12 wasn't
released with smartlinkable RTLs. Smartlinking causes only actually used procedures,
functions and constants to be linked in.</p>
<p>
System (syslinux, syswin32 depending on platform) is Pascal's base unit which is invisibly used
You can remedy this by using a development version and creating a smartlinking
RTL. See the <a href="makecyc.html">make cycle faq</a> or use a later release if available (0.99.14 and later do include a smartlinkable RTL). To turn on the generation of smartlinkable units, use the -Cx command line option when compiling
your units. To turn on the linking of previously generated smarlinkable units, use the -XX (-XS in 0.99.12 and earlier) command line option when compiling a program.
</p>
<li>Normally, all symbol information is included in the resulting program (for
easier debugging). You can remove this by using the -Xs command line
option when compiling your program (it won't do anything when compiling
units)
<lI>You can use UPX to pack the .EXEs (just like e.g. pklite) for Dos (GO32v2)
and Windows targets. Look <A HREF="http://wildsau.idv.uni-linz.ac.at/mfx/upx.html">here</A> for
more info.
<lI>You can use LXLITE for packing EMX binaries, but you won't be able to run
them under DOS (with extender) any more then. It might even not be possible
to use them on lower OS/2 versions (like 2.x) depending on chosen type
of compression. LXLITE can be found e.g. on <A HREF="http://hobbes.nmsu.edu">Hobbes</A>, search
for LXLITE.</li>
<li>Turn on optimalisations, both for supplied packages (RTL, API, FV, FCL) and for
your own code, this will also decrease the code size.
</ol>
<LI><A NAME="systemnotfound"></A><H3>Unit system, syslinux, sysos2 or syswin32 not found errors</H3>
<p>
System (syslinux, sysos2 or syswin32, depending on platform) is Pascal's base unit which is implicitely used
in all programs. This unit defines several standard procedures and structures, and must
be found to be able to compile any pascal program by FPC.<p>
be found to be able to compile any pascal program by FPC.
</p>
<p>
The location of the system.ppu and syslinux.o files are determined by the -Fu
switch which can be specified commandline, but is usually in the ppc386.cfg
(Win32: ppc386w.cfg) configuration file.<br>
(Win32: ppc386w.cfg) configuration file.
</p>
<p>
If the compiler can't find this unit there are three possible causes:
</p>
<ol>
<lI>The ppc386.cfg isn't in the same path as the compiler (go32v2 and win32),
or in /etc/ppc386.cfg or as .ppc386.cfg in your homedirectory (Linux). </li>
<lI>The ppc386.cfg isn't in the same path as the compiler executable (go32v2, win32 and OS/2)
or can't be found as "/etc/ppc386.cfg" or ".ppc386.cfg" in your homedirectory (Linux).
<li>The ppc386.cfg doesn't contain the -Fu line, or a wrong one.
See the <a href="http://www.freepascal.org/makecyc.html">make cycle faq</a> specially the chapters
about the ppc386.cfg and the directory structure.</li>
See the <a href="makecyc.html">make cycle faq</a>, especially the chapters
about the ppc386.cfg and the directory structure.
<li>The files ARE found but the wrong version or platform. Correct ppc386.cfg to
point to the right versions, or reinstall the right versions.</li>
point to the right versions or reinstall the right versions (this can happen
if you try to use a <A HREF="#snapshot">snapshot</A> compiler while the -Fu
statemnt in the used ppc386.cfg still points to the RTL that came with the
official release compiler).
</ol>
<p>
A handy trick can be executing &quot;ppc386 programname -vt&quot;, this shows
where the compiler is currently looking for the system unit's files. You might
want to pipe this through more(dos,windows) or less(Linux), since it can generate
more than one screen information:
where the compiler is currently looking for
the system unit's files. You might
want to pipe this through more (Dos, OS/2, Windows) or less (Linux), since it can generate more than one screen information:
</p>
<pre>
Dos,Windows:<br>
Dos, OS/2, Windows:
ppc386 programname -vt |more<br>
Linux:<br>
Linux:
ppc386 programname -vt |less<br>
</pre>
</p>
<LI><A NAME="KnownBugs"></A><H3>Known bugs</H3>
<P>
Go to the <A HREF="bugs.html">bugs page</A>
</P>
<LI><A NAME="ErrorPos"></A><H3>How can I find where an error occurred using the addresses a crashed program prints?</H3>
<OL>
<LI>Starting with version 1.00, the easiest possibility is to compile
your program with -gl debugging option. This way unit LineInfo is
automatically linked in, and the printout after a program crash then
contains source line numbers in addition to addresses.
<LI>For older versions, or more comprehensive checking, compile the program
with debugging information (use the -g command line option)
<LI>Load the program in the debugger (gdb(w) for 0.99.12b and earlier, gdbpas(w)
for 0.99.14 and later) using
<pre>gdb(pas)(w) --directory=&LT;src dirs&GT; myprog.exe</pre>
Notes:
<UL>
<LI>Under Linux, don't add the ".exe" after myprog
<LI>"<TT>src dirs</TT>" is a list of directories containing the source code
files of myprog and the units it uses seperated by semi-colons (";").
The current directory is automatically included.
</UL>
<LI>Once inside the debugger, you can (optionally) set the command line options
that will be passed to your program using the command "<TT>set args &LT;option1
option2 ...&GT;</TT>"
<LI>To start the program, type "<TT>run</TT>" and press enter
<LI>After the program has crashed, the address of the instruction where the crash
occurred will be shown.
The debugger will try to display the source code line corresponding with this
address. Note that this can be inside a procedure of the RTL, so the source
may not always be available and most likely the RTL wasn't compiled with
debugging information.
<LI>If you then type "<TT>bt</TT>" (BackTrace), the addreses in the call stack will
be shown (the addresses of the procedures which were called before the program
got to the current address). You can see which source code lines these present
using the command <pre>info line *&LT;address&GT;</pre>For example:<pre>info line *0x05bd8</pre>
</OL>
</ol>
<BR></TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@ -1,115 +1,69 @@
FreePascal FAQ
As distributed with FPC 0.99.14
This FAQ might not be up to date. See [1]the FPC FAQ on internet for
updates.
This FAQ is in no way a substitute for the extensive documentation
that accompanies FPC.
1. [2]What is Free Pascal(FPC) ?
2. [3]Which versions exist, and which one should I use?
3. [4]Known bugs
4. [5]Free Pascal and GNU Pascal - a comparison
5. [6]Where can I get the compiler ?
6. [7]What are the considerations in porting
7. [8]I tried to compile my Delphi code with the Free Pascal
Compiler,
8. [9]I have to write a program for homework. Can you help?
9. [10]How can I build a unit?
10. [11]Will Free Pascal support TV (Turbo Vision) in the future?
11. [12]How can I compile the system unit ?
12. [13]I get an internal error 9999
13. [14]How does function overloading work?
14. [15]How can I call C functions ?
15. [16]When will Free Pascal use DJGPP 2.0 under DOS/Windows ?
16. [17]How can I use the graph unit with Free Pascal ?
17. [18]Integrated Assembler syntax
18. [19]How to access DOS memory / How to do graphics ?
19. [20]Free Pascal without a math coprocessor
20. [21]Accessing more than 4 megabytes
21. [22]Access I/O ports
22. [23]I'm using the Dos compiler under Windows 95
23. [24]I'm using OS/2
24. [25]INSTALL.EXE of Dos version 0.99.10 reports "Load error: no
DPMI"
25. [26]INSTALL.EXE of Dos version 0.99.10 does not run in Windows NT
26. [27]I want a new version NOW
27. [28]Where can I find a text mode IDE for Dos
28. [29]How do I configure the Dos IDE
29. [30]Why are the generated binaries so big?
30. [31]Unit system, syslinux or syswin32 not found errors
Frequently Asked Questions
1. What is Free Pascal (FPC)?
Originally named FPK-Pascal, the Free Pascal compiler is a 32 bit
Turbo Pascal compatible Pascal compiler for DOS, Linux, Win32,
OS/2 and (based on an older version) the AmigaOS. More Operating
OS/2 and (based on an older version) the AmigaOS. More operating
systems are in the works.
The compiler is written in Pascal and is able to compile its own
sources. The source files are included.
Free Pascal requires a fast computer to run efficiently (386-25
Mhz for the Intel version and ideally a 68020 processor for the
Motorola version). At least 2 megabytes of RAM is required. To
remake the compiler more than 16 is recommended.
Free Pascal is modest regarding its minimal system requirements
(386-25 Mhz for the Intel version and ideally a 68020 processor
for the Motorola version). At least 2 megabytes of RAM are
required. To remake the compiler more than 16MB is recommended.
Short history:
6/1993 project start
10/1993 first little programs work
3/1995 the compiler compiles the own sources
3/1996 released to the internet
probably 2000 1.0 version
+ 6/1993: project start
+ 10/1993: first little programs work
+ 3/1995: the compiler compiles the own sources
+ 3/1996: released to the internet
+ 7/2000: 1.0 version
2. Which versions exist, and which one should I use?
Compilers with an even last number are release versions(e.g.
0.99.8, 0.99.10, 0.99.12 and 0.99.14)
0.99.8, 0.99.10, 0.99.12, 0.99.14 and 1.00)
Compilers and packages with an odd last number are development
versions (e.g. 0.99.9, 0.99.11, 0.99.13 and 0.99.15).
versions (e.g. 0.99.9, 0.99.11, 0.99.13, 0.99.15 and 1.0.9).
0.99.5 is an exception to this rule, since 0.99.5 IS a release (a
release prior to the introduction of this odd/even system)
Letters behind the version number (0.99.12b, 0.99.5d) indicate
release versions with some bugs and problems in the original
release (respectively 0.99.12 and 0.99.5) fixed.
Normally you would want to use a release. Releases are considered
stable, and easier to support. (the bugs, quirks and unintended
stable, and easier to support (the bugs, quirks and unintended
"features" are well known after a period of time, and workarounds
exist).
Development snapshots which are generated daily reflect the
Development snapshots (which are generated daily) reflect the
current status of the compiler. Development versions probably have
new features and larger bugs fixed since the last release, but
might have some temporary stability drawbacks, (btw which are
usually fixed quite soon)
might have some temporary stability drawbacks (which are usually
fixed by the next day)
Most support for development snapshots are basically the advise to
upgrading to newer snapshot in which the bugs are hopefully fixed.
upgrade to newer snapshot in which the bugs are hopefully fixed.
Since version 0.99.8 the stability of the compiler steadily
increased, and development snapshots are often quite useful for
increased and development snapshots are often quite useful for
certain categories of users. Ask in the maillists if it is worth
the effort in your case.
The current release version is 0.99.14 for the OS/2,Linux,Windows
and Dos (Go32V2) targets,
and 0.99.5d for the 680x0 based systems (mainly Amiga and Mac)
The current development snapshot version is 0.99.13 or 0.99.15.
3. Known bugs
Go to the [32]bugs page
4. Free Pascal and GNU Pascal - a comparison
the trouble in your case if you're not sure.
The current release version is 1.00 for the OS/2, Linux, Windows
and Dos (Go32V2) targets and 0.99.5d for the 680x0 based systems
(Amiga and Atari ST)
The current development snapshot version is 1.0.9.
3. Free Pascal and GNU Pascal - a comparison
aim:
Aim:
Free Pascal tries to implement a Borland compatible
pascal compiler on as many platforms as possible. GNU
Pascal tries to implement a portable pascal compiler
based on POSIX.
Version:
Currently, Free Pascal is at version 0.99.12 for the
Intel version, and version 1.0 will be out soon, and
version 0.99.5d for the Motorola/Intel version. Version
0.99.5d differs from version 0.99.5 in that all run time
library fixes have been applied, as well as all known
code generation bugs. Version 0.99.12 differs from
version 0.99.5c in that all parser bugfixes have also
been applied and also a lot of Delphi 2 and Delphi 3
extensions have been implemented. GNU Pascal is at
version 2.7.2 (but this numbering is not really an
Currently, Free Pascal is at version 1.00 for the Intel
version and version 0.99.5d for the Motorola/Intel
version. Version 0.99.5d differs from version 0.99.5 in
that all run time library fixes have been applied, as
well as all known code generation bugs. Version 1.00
differs from version 0.99.5d in that all parser bugfixes
have also been applied and also a lot of Delphi 2 and
Delphi 3 extensions have been implemented. GNU Pascal is
at version 2.8.1 (but this numbering is not really an
indication, it follows the GNU C numbering, since it is a
derivation of it)
@ -127,27 +81,26 @@
Language:
Free Pascal supports the Borland Pascal dialect Borland,
and implements the Delphi Object PAscal language. GNU
and implements the Delphi Object Pascal language. GNU
Pascal supports ISO 7185, ISO 10206, (most of) Borland
Pascal 7.0
Extensions:
Free Pascal implements function overloading, and operator
overloading). GNU Pascal implements operator overloading.
Free Pascal implements function overloading and operator
overloading. GNU Pascal implements operator overloading.
License:
Both compilers come under the GNU GPL.
Author:
Free Pascal was started by Florian Klaempfl, Germany
(klaempfl@haegar.cip.mw.tu-muenchen.de), GNU Pascal was
started by Jukka Virtanen, Finland, (jtv@hut.fi).
(Florian.Klaempfl@gmx.de), GNU Pascal was started by
Jukka Virtanen, Finland (jtv@hut.fi).
5. Where can I get the compiler ?
Free Pascal is available for download from all [33]official
4. Where can I get the compiler ?
Free Pascal is available for download from all [46]official
mirrors
6. What are the considerations in porting code to other processors?
5. What are the considerations in porting code to other processors?
Because the compiler now supports processors other than the Intel,
it is important to take a few precautions so that your code will
execute correctly on all processors.
@ -158,7 +111,7 @@
using packed on objects,classes and records may break this
requirement. If this is the case your code will simply crash
on the target processors.
+ Clean up at the end of your program, i.e close all files on
+ Clean up at the end of your program, i.e. close all files on
exit, as some operating systems don't like it when some files
are left opened.
+ Try not to rely on the endian of the specific machines when
@ -172,18 +125,16 @@
+ Try limiting the size of parameters passed to subroutines to
32K, as this is the limit of some processors, use const or
var parameters instead.
7. I tried to compile my Delphi code with the Free Pascal Compiler,
it seems that it doesn't recognize the OOP.
The compiler supports the Delphi OOP. There may be some bugs, of
course, You should try the -S2, -Sd or -So switches (see the
manuals for the meaning of these switches)
8. I have to write a program for homework. Can you help?
6. I tried to compile my Delphi code with the Free Pascal Compiler,
but it seems that it doesn't recognize Delphi style OOP.
The compiler supports the Delphi OOP. Make sure you use the -S2 or
-Sd switches (see the manuals for the meaning of these switches).
7. I have to write a program for homework. Can you help?
No. Please, don't send us mail about homework, we are no teachers.
The Free Pascal development team tries to give good support for
the Free Pascal compiler and are trying to always reply to emails.
If we get emails like this, this becomes harder and harder.
9. How can I build a unit?
8. How can I build a unit?
It works like in Turbo Pascal. The first keyword in the file must
be UNIT (not case sensitive). The compiler will generate two
files: XXX.PPU and XXX.O. The PPU file contains the interface
@ -191,13 +142,13 @@
object file, whose precise structure depends on the assembler you
used). To use this unit in another unit or program, you must
include its name in the USES clause of your program.
10. Will Free Pascal support TV (Turbo Vision) in the future?
9. Will Free Pascal support TV (Turbo Vision) in the future?
A Turbo Vision port, called Free Vision, has progressed nicely
lately. It's already very usable, we are even writing an IDE in
it. Due to copyrights problem the FreeVision source code is not
available at the moment. You can download the IDE from the
[34]development page. and get an idea of the look and feel though.
11. How can I compile the system unit ?
[47]development page. and get an idea of the look and feel though.
10. How can I compile the system unit?
To recompile the system unit, it is recommended to have GNU make
installed. typing 'make' in the rtl source directory will then
recompile all RTL units including the system unit. You may choose
@ -205,32 +156,27 @@
a 'make' there.
It is possible to do all this manually, but you need more detailed
knowledge of the RTL tree structure for that.
12. I get an internal error 9999
The latest versions of the Free Pascal Compiler come with a Error
Handling routine which catches the segmentation fault, and lets
the compiler exit gracefully. This is reported as an internal
error 9999.
Please try to reproduce the error and send [35]us a bug report.
11. I get an internal error 9999
The latest versions of the Free Pascal Compiler come with an error
handling routine which catches the segmentation fault and lets the
compiler to exit gracefully. This is reported as an internal error
9999. Please try to reproduce the error and send [48]us a bug
report.
(For the curious, IE 9999 is not a specific bug. It is a safety
measure which terminates if during compiling a certain condition
is not met, which can be caused by several bugs. So if you report
the bug, and get IE 9999 later in a different piece or part of
sourcecode, it could be a completely different bug)
13. How does function overloading work?
sourcecode, it could be a completely different bug.)
12. How does function overloading work?
function overloading is implemented, like in C++:
procedure a(i : integer);
begin
end;
procedure a(s : string);
begin
end;
begin
a('asdfdasf");
a('asdfdasf');
a(1234);
end.
You must be careful. If one of your overloaded functions is in the
@ -239,236 +185,245 @@
complain with a 'This overloaded function can't be local' message.
Overloaded functions must differ in their parameters, it's not
enough if their return types are different.
14. How can I call C functions ?
13. How can I call C functions?
C calling convention is implemented as follows: The compiler
pushes the parameters from right to left, but the procedure has to
clear the stack. For calling the C function strcmp declare the
following:
function strcmp(s1 : pchar;s2 : pchar) : integer;cdecl;external;
Since 0.99.5, the older [C]; won't work!
15. When will Free Pascal use DJGPP 2.0 under DOS/Windows ?
14. When will Free Pascal use DJGPP 2.0 under DOS/Windows?
As of version 0.99.0 Free Pascal uses DJGPP 2.0. DJGPP v1.2
support has been removed since version FPC 0.99.8.
16. How can I use the graph unit with Free Pascal ?
Look at InitGraph.
17. Integrated Assembler syntax
15. How can I use the graph unit with Free Pascal?
Since 0.99.12, the graph unit is available both for Dos and Linux.
Under Dos, it only supported VESA modes though. Since version
0.99.14, a new more system independant graph unit is included
(although the only extra supported OS is Win32 and this is only
rudimentary support) which also supports standard VGA.
16. Integrated Assembler syntax
The default assembler syntax (AT&T style) is different from the
one in Borland Pascal (Intel style).
However, as of version 0.99.0, the compiler supports Intel style
assembly syntax. See the documentation for more info on how to use
different assembler styles.
A description of the AT&T syntax can be found in the DJGPP FAQ
[36]http://www.delorie.com/djgpp/v2faq/faq102.html#Syntax or in
[49]http://www.delorie.com/djgpp/v2faq/faq102.html#Syntax or in
Brennan's Guide to Inline Assembly
[37]http://www.rt66.com/~brennan/djgpp/djgpp_asm.html. The
[50]http://www.rt66.com/%7Ebrennan/djgpp/djgpp asm.html. The
documentation also contains a chapter where the difference between
the Intel and AT&T style assembly is explained.
Or you can use the convertor program at
http://rcs.urz.tu-dresden.de/ schoenfu/zip/asmtrans.zip.
18. How to access DOS memory / How to do graphics ?
You can do like in TP, via absolute or mem, for larger blocks use
the dosmemput/dosmemget routines in unit Go32
19. Free Pascal without a math coprocessor
[51]http://rcs.urz.tu-dresden.de/schoenfu/zip/asmtrans.zip .
17. How can I access DOS memory / How can I do graphics programming?
You can do like in TP, via absolute or mem[]. For larger memory
blocks use the dosmemput/dosmemget routines in Go32 unit.
18. How can I run Free Pascal without a math coprocessor?
On the Intel version the emulator is automatically loaded by the
compiler, the file is bin\emu387.
SET GO32=EMU C:\PP\BIN\EMU387
20. Accessing more than 4 megabytes
By default Free Pascal allocates only 4 meg. If it just allocated
all it could get, people running windows would have problems as
Windows would increase the swap file size to give the program more
memory on and on, until the swap file drive would be full.
compiler if you add the following commands to your autoexec.bat:
SET 387=N
SET EMU386=C:\PP\BIN\GO32V2\WEMU387.DXE
(don't forget to replace the C:\PP with the directory where you
installed FPC)
19. How do I reserve more than 2 megabytes of RAM?
By default Free Pascal allocates only 2MB of RAM for your
application. If it just allocated all it could get, people running
Windows would have problems as Windows would increase the swap
file size to give the program more memory on and on, until the
swap file drive would be full.
You can specify the size of the heap with -Chxxxx. The default
value is -Ch4000000. Try -Ch10000000, provided you got enough swap
space.
However, the heap size doesn't really matter anymore, since the
Heap is able to grow. That is, if you've used all available heap
space, the program will try to get more memory from the OS, thus
the heap is limited to the maximum amount of free memory provided
by the OS.
21. Access I/O ports
If you're under DOS, you should use the outport* and inport*
procedures of the go32 unit.
Heap is able to grow: if you've used all the available heap space,
the program will try to get more memory from the OS, so the heap
is limited to the maximum amount of free memory provided by the
OS.
It is only handy if you know you will need at least a certain
amount of memory. You can then specify this value using the -Ch
parameter, so your program will allocate it at once on startup.
This is slightly faster than growing the heap a number of times.
20. How can I access I/O ports?
With versions before 0.99.10: if you're under DOS you can use the
outport* and inport* procedures of the go32 unit.
Since version 0.99.8, the Port array is supported like in TP, as
long as you use the ports unit in your program.
22. I'm using the Dos compiler under Windows 95
long as you use the ports unit in your program (not available
under Win32).
21. I'm using the Dos compiler under Windows 95
There is a problem with the Dos compiler and Win 95 on computers
with less than 16 MB. First set in the properties of the DOS box
the DPMI memory size to max value. Now try to start a demo program
in the DOS box, e.g. HELLO (starting takes some time). If this
works you will be able to get the compiler to work by recompiling
it with a smaller heap size, perhaps 2 or 4 MB (option -Chxxxx).
23. I'm using OS/2
Problems have been reported that the Go32v2 compiler does not run
on some OS/2 installations. You can use the native OS/2 compiler,
or compile a GO32V1 compiler yourself.
24. INSTALL.EXE of Dos version 0.99.10 reports "Load error: no DPMI"
22. I'm using OS/2
Problems have been reported that the GO32v2 compiler does not run
on some OS/2 installations. You can use the native OS/2 compiler
(strongly preferred solution) or maybe compile a GO32v1 compiler
yourself. However, the GO32v2 version should generally work under
OS/2 as well.
23. INSTALL.EXE of Dos version 0.99.10 reports "Load error: no DPMI"
The file cwsdpmi.exe is missing in the main directory of the zip
archive. The above message pops up of no other DPMI services are
archive. The above message pops up if no other DPMI services are
available. Such services are for example available in a Dos window
of Windows. You can either extract that file from basego32.zip or
download it from
[38]http://www.brain.uni-freiburg.de/~klaus/cwsdpmi.exe. Put it
[52]http://www.brain.uni-freiburg.de/%7Eklaus/cwsdpmi.exe. Put it
into the same directory as install.exe and run install again.
25. INSTALL.EXE of Dos version 0.99.10 does not run in Windows NT
24. INSTALL.EXE of Dos version 0.99.10 does not run in Windows NT
This is an incompatibility of the mouse driver. Use this new
version of install.exe instead:
[39]ftp://ftp.freepascal.org/pub/fpc/snapshot/install.exe
26. I want a new version NOW
[53]ftp://ftp.freepascal.org/pub/fpc/snapshot/install.exe
25. I want a new version NOW
In the time between the release of new official versions, you can
have a look at and test developer versions. Be warned though: this
is work under progress, so in addition to old bugs fixed and new
features added, this may also contain new bugs. The snapshot is
generated automatically each night from the current source at that
moment. Somethimes this may fail due to bigger changes not yet
fully implemented. If your version doesn't work, try again one or
two days later. Don't download the Go32V1 version for Dos, it's
not supported any more.
The latest snapshot can be downloaded from the [40]development web
page.
have a look at and test developer versions (so-called
"snapshots"). Be warned though: this is work under progress, so in
addition to old bugs fixed and new features added, this may also
contain new bugs.
Snapshots are generated automatically each night from the current
source at that moment. Sometimes this may fail due to bigger
changes not yet fully implemented. If your version doesn't work,
try again one or two days later. You're advised not to download
the GO32v1 version for Dos, since it's not supported any more.
The latest snapshot can always be downloaded from the
[54]development web page.
To install a snapshot, extract the zip archive into the existing
program directory of the last official version of fee pascal
(after making a backup of the original of course). Or extract it
into an empty directory, then move the files to the program
directory, overwriting existing files. Make sure that you extract
the ZIP archiv such that the included directory structure remains
intact, for example if you use PKUNZIP, use "pkuzip -d" instead of
just "pkunzip".
27. Where can I find a text mode IDE for Dos
program directory of the last official version of Free Pascal
(after making a backup of the original of course). You can also
extract it into an empty directory and then move the files to the
program directory, overwriting existing files. Make sure that you
extract the ZIP archive such that the included directory structure
remains intact. For example if you use PKUNZIP, use "pkunzip -d"
instead of just "pkunzip". Note that snpashots also contain a new
RTL which most likely can't be used with the previous release
version, so backup your old RTL as well.
26. Where can I find a text mode IDE?
The development of the IDE (integrated development environment) is
not yet finished. However a working test version of the IDE is
available as snapshot. It requires the latest compiler snapshot be
installed on top of the last official Dos version 0.99.12 for
Go32V2. So if you have not already done it, first install the last
official version (file dos09912.zip or dos09912full.zip, you find
these in the [41]download section). Then get and extract the
latest Dos snapshot for DOS-GO32V2 (snapshot.zip) into the
directory containing the last official version. Then do the same
with one of the IDE snapshots (the debugger does not work very
well yet, so start with the version "IDE with compiler"). For more
details on where to find and how to install a snapshot, please see
the previous FAQ item. For additional instructions for required
IDE configuration please also read the next FAQ item.
28. How do I configure the Dos IDE
installed on top of the current official version for your
particular platform (1.00 for GO32v2 or Win32). So if you have not
already done that, first install the latest official version (e.g.
file dos100.zip or dos100full.zip, you find these in the
[55]download section).
Then get and extract the latest snapshot for your platform (e.g.
snapshot.zip) into the directory containing the official version.
Next, do the same with one of the IDE snapshots. For more details
on where to find and how to install a snapshot, please see the
previous FAQ item. For additional instructions for required IDE
configuration please also read the next FAQ item.
27. How do I configure the Dos IDE?
Once you have installed the IDE (see the previous FAQ item), it
requires two configuration changes before it can compile. This is
due to the fact that the IDE includes its own compiler, it does
due to the fact that the IDE includes its own compiler; it does
not use ppc386.exe and thus it also does not use the configuration
in the file ppc386.cfg. Thus if you try to compile, you get an
error message telling that it can not compile the system unit. To
fix this start fp.exe, select from the menu Compile, then Target
then Go32V2. Next select the menu Options/Directories and in the
in the file ppc386.cfg.
Start fp.exe, select Target from the Compile menu and then check
GO32v2. Next, choose Directories in the Otions menu and in the
line "Unit directories" enter the path to your copy of the rtl
directory, usually c:\pp\units\go32v2\rtl. If you have done
everything correct and it still doesn't work, you may have grabbed
a snapshot that has a bug, in this case try again one or two days
later.
29. Why are the generated binaries so big?
There are several reasons and remedies for this.
1. If you are using 0.99.12: Due to some problems with the binary
writer, the 0.99.12 and fixes weren't released with smartlinking
RTLs. Smartlinking causes only actually used procedures, functions
and constants to be linked in.
You can remedy this by using a development version and creating a
smartlinking RTL. See the [42]make cycle faq or use a later
release if available.
2. Generating debug code (-g options) is enabled. Use the strip
utility (or stripw for the windows platform) to remove the
debuginformation.
The utility is supplied with the releases, except under Linux were
it is part of the GNU binutils package.
3. Under Dos(Go32V2) and windows targets you can use UPX to pack the
.EXEs (just like e.g. pklite). The architecture of linux doesn't
allow binary packing.
4. You can use LXLITE for packing EMX binaries, but you won't be able
to run them under DOS any more then. It might even not be possible
to use them on lower OS/2 versions (like 2.x) depending on chosen
type of compression.
5. Turning on optimalisations, both for supplied packages
(RTL,API,FV,FCL) as for your own code, will also decrease
code-size.
Unit system, syslinux or syswin32 not found errors
System (syslinux, syswin32 depending on platform) is Pascal's base
unit which is invisibly used in all programs. This unit defines
several standard procedures and structures, and must be found to be
able to compile any pascal program by FPC.
The location of the system.ppu and syslinux.o files are determined by
the -Fu switch which can be specified commandline, but is usually in
the ppc386.cfg (Win32: ppc386w.cfg) configuration file.
If the compiler can't find this unit there are three possible causes:
1. The ppc386.cfg isn't in the same path as the compiler (go32v2 and
win32), or in /etc/ppc386.cfg or as .ppc386.cfg in your
homedirectory (Linux).
2. The ppc386.cfg doesn't contain the -Fu line, or a wrong one. See
the [43]make cycle faq specially the chapters about the ppc386.cfg
and the directory structure.
3. The files ARE found but the wrong version or platform. Correct
ppc386.cfg to point to the right versions, or reinstall the right
versions.
A handy trick can be executing "ppc386 programname -vt", this shows
where the compiler is currently looking for the system unit's files.
You might want to pipe this through more(dos,windows) or less(Linux),
since it can generate more than one screen information:
Dos,Windows:
directory, usually c:\pp\rtl\go32v2. If you have done everything
correct and it still doesn't work, you may have grabbed a snapshot
that has a bug; in this case try again one or two days later or
ask for help on one of the [56]mailing lists.
28. Why are the generated binaries so big?
There are several reasons and remedies for this:
1. If you are using 0.99.12: Due to some problems with the
binary writer, 0.99.12 wasn't released with smartlinkable
RTLs. Smartlinking causes only actually used procedures,
functions and constants to be linked in.
You can remedy this by using a development version and
creating a smartlinking RTL. See the [57]make cycle faq or
use a later release if available (0.99.14 and later do
include a smartlinkable RTL). To turn on the generation of
smartlinkable units, use the -Cx command line option when
compiling your units. To turn on the linking of previously
generated smarlinkable units, use the -XX (-XS in 0.99.12 and
earlier) command line option when compiling a program.
2. Normally, all symbol information is included in the resulting
program (for easier debugging). You can remove this by using
the -Xs command line option when compiling your program (it
won't do anything when compiling units)
3. You can use UPX to pack the .EXEs (just like e.g. pklite) for
Dos (GO32v2) and Windows targets. Look [58]here for more
info.
4. You can use LXLITE for packing EMX binaries, but you won't be
able to run them under DOS (with extender) any more then. It
might even not be possible to use them on lower OS/2 versions
(like 2.x) depending on chosen type of compression. LXLITE
can be found e.g. on [59]Hobbes, search for LXLITE.
5. Turn on optimalisations, both for supplied packages (RTL,
API, FV, FCL) and for your own code, this will also decrease
the code size.
29. Unit system, syslinux, sysos2 or syswin32 not found errors
System (syslinux, sysos2 or syswin32, depending on platform) is
Pascal's base unit which is implicitely used in all programs. This
unit defines several standard procedures and structures, and must
be found to be able to compile any pascal program by FPC.
The location of the system.ppu and syslinux.o files are determined
by the -Fu switch which can be specified commandline, but is
usually in the ppc386.cfg (Win32: ppc386w.cfg) configuration file.
If the compiler can't find this unit there are three possible
causes:
1. The ppc386.cfg isn't in the same path as the compiler
executable (go32v2, win32 and OS/2) or can't be found as
"/etc/ppc386.cfg" or ".ppc386.cfg" in your homedirectory
(Linux).
2. The ppc386.cfg doesn't contain the -Fu line, or a wrong one.
See the [60]make cycle faq, especially the chapters about the
ppc386.cfg and the directory structure.
3. The files ARE found but the wrong version or platform.
Correct ppc386.cfg to point to the right versions or
reinstall the right versions (this can happen if you try to
use a [61]snapshot compiler while the -Fu statemnt in the
used ppc386.cfg still points to the RTL that came with the
official release compiler).
A handy trick can be executing "ppc386 programname -vt", this
shows where the compiler is currently looking for the system
unit's files. You might want to pipe this through more (Dos, OS/2,
Windows) or less (Linux), since it can generate more than one
screen information:
Dos, OS/2, Windows:
ppc386 programname -vt |more
Linux:
ppc386 programname -vt |less
References
1. http://www.freepascal.org/faq.html
2. file://localhost/home/pfv/cvs/install/doc/faq.html#WhatIsFP
3. file://localhost/home/pfv/cvs/install/doc/faq.html#versions
4. file://localhost/home/pfv/cvs/install/doc/faq.html#KnownBugs
5. file://localhost/home/pfv/cvs/install/doc/faq.html#FPandGNUPascal
6. file://localhost/home/pfv/cvs/install/doc/faq.html#WhereToGetFP
7. file://localhost/home/pfv/cvs/install/doc/faq.html#PortabilityTips
8. file://localhost/home/pfv/cvs/install/doc/faq.html#OOP
9. file://localhost/home/pfv/cvs/install/doc/faq.html#HOMEWORK
10. file://localhost/home/pfv/cvs/install/doc/faq.html#HowcanIbuildaunit
11. file://localhost/home/pfv/cvs/install/doc/faq.html#TurboVision
12. file://localhost/home/pfv/cvs/install/doc/faq.html#CompileSystemUnit
13. file://localhost/home/pfv/cvs/install/doc/faq.html#Internalerror9999
14. file://localhost/home/pfv/cvs/install/doc/faq.html#Howdoesfunctionoverloadingwork
15. file://localhost/home/pfv/cvs/install/doc/faq.html#HowToCallCFuncuntions
16. file://localhost/home/pfv/cvs/install/doc/faq.html#DJGPP2support
17. file://localhost/home/pfv/cvs/install/doc/faq.html#HowToUseGraph
18. file://localhost/home/pfv/cvs/install/doc/faq.html#IntegratedAssemblerSyntax
19. file://localhost/home/pfv/cvs/install/doc/faq.html#HowToAccessDosMemory
20. file://localhost/home/pfv/cvs/install/doc/faq.html#FPwithoutfpu
21. file://localhost/home/pfv/cvs/install/doc/faq.html#AccessingMoreThan4MB
22. file://localhost/home/pfv/cvs/install/doc/faq.html#accessioports
23. file://localhost/home/pfv/cvs/install/doc/faq.html#ImusingWin95
24. file://localhost/home/pfv/cvs/install/doc/faq.html#ImusingOS2
25. file://localhost/home/pfv/cvs/install/doc/faq.html#dpmi
26. file://localhost/home/pfv/cvs/install/doc/faq.html#winnt
27. file://localhost/home/pfv/cvs/install/doc/faq.html#snapshot
28. file://localhost/home/pfv/cvs/install/doc/faq.html#ideinst
29. file://localhost/home/pfv/cvs/install/doc/faq.html#ideconfig
30. file://localhost/home/pfv/cvs/install/doc/faq.html#binariesbig
31. file://localhost/home/pfv/cvs/install/doc/faq.html#systemnotfound
32. http://www.freepascal.org/bugs.html
33. http://www.freepascal.org/download.html
34. http://www.freepascal.org/develop.html#snapshot
35. http://www.freepascal.org/moreinfo.html
36. http://www.delorie.com/djgpp/v2faq/faq102.html#Syntax
37. http://www.rt66.com/~brennan/djgpp/djgpp_asm.html
38. http://www.brain.uni-freiburg.de/~klaus/cwsdpmi.exe
39. ftp://ftp.freepascal.org/pub/fpc/snapshot/install.exe
40. http://www.freepascal.org/develop.html#snapshot
41. http://www.freepascal.org/download.html
42. http://www.freepascal.org/makecyc.html
43. http://www.freepascal.org/makecyc.html
30. Known bugs
Go to the [62]bugs page
31. How can I find where an error occurred using the addresses a
crashed program prints?
1. Starting with version 1.00, the easiest possibility is to
compile your program with -gl debugging option. This way unit
LineInfo is automatically linked in, and the printout after a
program crash then contains source line numbers in addition
to addresses.
2. For older versions, or more comprehensive checking, compile
the program with debugging information (use the -g command
line option)
3. Load the program in the debugger (gdb(w) for 0.99.12b and
earlier, gdbpas(w) for 0.99.14 and later) using
gdb(pas)(w) --directory=<src dirs>; myprog.exe
Notes:
o Under Linux, don't add the ".exe" after myprog
o "src dirs" is a list of directories containing the
source code files of myprog and the units it uses
seperated by semi-colons (";"). The current directory is
automatically included.
4. Once inside the debugger, you can (optionally) set the
command line options that will be passed to your program
using the command "set args <;option1 option2 ...>"
5. To start the program, type "run" and press enter
6. After the program has crashed, the address of the instruction
where the crash occurred will be shown. The debugger will try
to display the source code line corresponding with this
address. Note that this can be inside a procedure of the RTL,
so the source may not always be available and most likely the
RTL wasn't compiled with debugging information.
7. If you then type "bt" (BackTrace), the addreses in the call
stack will be shown (the addresses of the procedures which
were called before the program got to the current address).
You can see which source code lines these present using the
command
info line *<address>
For example:
info line *0x05bd8

View File

@ -81,11 +81,9 @@ OS/2 and DOS (extender EMX):
****************************************************************************
The current version is only an evaluation version.
* Quick start
****************************************************************************
Quick start
-----------
Download dos100.zip (version for DOS) or w32100.zip (version for
Win9x/NT) or os2100.zip (EMX version - for OS/2 and DOS) and unzip it
into a temporary directory.