faq.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. <html>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
  3. "http://www.w3.org/TR/REC-html40/loose.dtd">
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  6. <META NAME="Author" CONTENT="Free Pascal Web Team">
  7. <META name="description" content="Free Pascal: free 32-bit Pascal compiler for DOS, Linux, Win32 and OS/2">
  8. <META NAME="keywords" content="32 bit, protected mode, compiler, pascal, FPC, FPC Pascal, Free Pascal">
  9. <TITLE>Free Pascal - Online documentation</TITLE>
  10. </HEAD>
  11. <BODY TEXT="#000000" BGCOLOR="#FFCC99" LINK="#0000EE" VLINK="#551A8B"
  12. ALINK="#FF8080"><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
  13. <center><h1> FreePascal FAQ</h1>
  14. <h3>As distributed with FPC 0.99.14</center></h3><p>
  15. <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>
  16. This FAQ is in no way a substitute for the extensive documentation that accompanies FPC.<p>
  17. <OL>
  18. <!-- IDXSTART -->
  19. <LI><A HREF="#WhatIsFP">What is Free Pascal(FPC) ?</A></LI>
  20. <LI><A HREF="#versions">Which versions exist, and which one should I use?</A></LI>
  21. <LI><A HREF="#KnownBugs">Known bugs</A></LI>
  22. <LI><A HREF="#FPandGNUPascal">Free Pascal and GNU Pascal - a comparison</A></LI>
  23. <LI><A HREF="#WhereToGetFP">Where can I get the compiler ?</A></LI>
  24. <LI><A HREF="#PortabilityTips">What are the considerations in porting</A></LI>
  25. <LI><A HREF="#OOP">I tried to compile my Delphi code with the Free Pascal Compiler,</A></LI>
  26. <LI><A HREF="#HOMEWORK">I have to write a program for homework. Can you help?</A></LI>
  27. <LI><A HREF="#HowcanIbuildaunit">How can I build a unit?</A></LI>
  28. <LI><A HREF="#TurboVision">Will Free Pascal support TV (Turbo Vision) in the future?</A></LI>
  29. <LI><A HREF="#CompileSystemUnit">How can I compile the system unit ?</A></LI>
  30. <LI><A HREF="#Internalerror9999">I get an internal error 9999</A></LI>
  31. <LI><A HREF="#Howdoesfunctionoverloadingwork">How does function overloading work?</A></LI>
  32. <LI><A HREF="#HowToCallCFuncuntions">How can I call C functions ?</A></LI>
  33. <LI><A HREF="#DJGPP2support">When will Free Pascal use DJGPP 2.0 under DOS/Windows ?</A></LI>
  34. <LI><A HREF="#HowToUseGraph">How can I use the graph unit with Free Pascal ?</A></LI>
  35. <LI><A HREF="#IntegratedAssemblerSyntax">Integrated Assembler syntax</A></LI>
  36. <LI><A HREF="#HowToAccessDosMemory">How to access DOS memory / How to do graphics ?</A></LI>
  37. <LI><A HREF="#FPwithoutfpu">Free Pascal without a math coprocessor</A></LI>
  38. <LI><A HREF="#AccessingMoreThan4MB">Accessing more than 4 megabytes</A></LI>
  39. <LI><A HREF="#accessioports">Access I/O ports</A></LI>
  40. <LI><A HREF="#ImusingWin95">I'm using the Dos compiler under Windows 95</A></LI>
  41. <LI><A HREF="#ImusingOS2">I'm using OS/2</A></LI>
  42. <LI><A HREF="#dpmi">INSTALL.EXE of Dos version 0.99.10 reports "Load error: no DPMI"</A></LI>
  43. <LI><A HREF="#winnt">INSTALL.EXE of Dos version 0.99.10 does not run in Windows NT</A></LI>
  44. <LI><A HREF="#snapshot">I want a new version NOW</A></LI>
  45. <LI><A HREF="#ideinst">Where can I find a text mode IDE for Dos</A></LI>
  46. <LI><A HREF="#ideconfig">How do I configure the Dos IDE</A></LI>
  47. <LI><A HREF="#binariesbig">Why are the generated binaries so big?</A></LI>
  48. <LI><A HREF="#systemnotfound">Unit system, syslinux or syswin32 not found errors</A></LI>
  49. <!-- IDXEND -->
  50. </OL>
  51. <OL>
  52. <A NAME="WhatIsFP"></A>
  53. <H3><LI>What is Free Pascal(FPC) ?</LI></H3>
  54. <P>
  55. Originally named FPK-Pascal, the Free Pascal compiler is a 32 bit Turbo
  56. Pascal compatible Pascal compiler for DOS, Linux, Win32, OS/2 and (based on
  57. an older version) the AmigaOS.
  58. More Operating systems are in the works. <BR>
  59. The compiler is written in Pascal and is able to compile its own sources.
  60. The source files are included. <BR>
  61. Free Pascal requires a fast computer to run efficiently (386-25 Mhz for
  62. the Intel version and ideally a 68020 processor for the Motorola
  63. version). At least 2 megabytes of RAM is required. To remake the compiler
  64. more than 16 is recommended.
  65. </P>
  66. <P>Short history: <BR>
  67. <B>&nbsp;6/1993</B> project start <BR>
  68. <B>10/1993</B> first little programs work <BR>
  69. <B>&nbsp;3/1995</B> the compiler compiles the own sources <BR>
  70. <B>&nbsp;3/1996</B> released to the internet<br>
  71. <B>&nbsp;probably 2000</b> 1.0 version
  72. </P>
  73. <A NAME="versions"></A>
  74. <H3><LI>Which versions exist, and which one should I use?</LI></H3>
  75. <p>
  76. 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>
  77. 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>
  78. 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>
  79. Letters behind the version number (0.99.12b, 0.99.5d) indicate release versions with some
  80. bugs and problems in the original release (respectively 0.99.12 and 0.99.5) fixed.<p>
  81. Normally you would want to use a release. Releases are considered stable, and
  82. easier to support. (the bugs, quirks and unintended &quot;features&quot; are wellknown after a period of time,
  83. and workarounds exist).<p>
  84. Development snapshots which are generated daily reflect the current status of the compiler.
  85. Development versions probably have new features and larger bugs fixed since the last release,
  86. but might have some temporary stability drawbacks, (btw which are usually fixed quite soon)<p>
  87. Most support for development snapshots are basically the advise to
  88. upgrading to newer snapshot in which the bugs are hopefully fixed.<p>
  89. Since version 0.99.8 the stability of the compiler steadily increased, and development
  90. snapshots are often quite useful for certain categories of users. Ask in the maillists
  91. if it is worth the effort in your case.<p>
  92. <br>
  93. The current release version is 0.99.14 for the OS/2,Linux,Windows and Dos (Go32V2) targets,<br>
  94. and 0.99.5d for the 680x0 based systems (mainly Amiga and Mac)<p>
  95. The current development snapshot version is 0.99.13 or 0.99.15.<p>
  96. </P>
  97. <A NAME="KnownBugs"></A>
  98. <H3><LI>Known bugs</LI></H3>
  99. <P>
  100. Go to the <A HREF="http://www.freepascal.org/bugs.html">bugs page</A>
  101. </P>
  102. <A NAME="FPandGNUPascal"></A>
  103. <H3><LI>Free Pascal and GNU Pascal - a comparison</LI></H3>
  104. <DL>
  105. <DT><B>aim:</B></DT>
  106. <DD>Free Pascal tries to implement a Borland compatible pascal compiler
  107. on as many platforms as possible. GNU Pascal tries to implement a portable
  108. pascal compiler based on POSIX.</DD>
  109. <DT><B>Version:</B></DT>
  110. <DD>Currently, Free Pascal is at version 0.99.12 for the Intel version,
  111. and version 1.0 will be out soon,
  112. and version 0.99.5d for the Motorola/Intel version. Version 0.99.5d differs
  113. from version 0.99.5 in that all run time library fixes have been
  114. applied, as well as all known code generation bugs. Version 0.99.12
  115. differs from version 0.99.5c in that all parser bugfixes have also
  116. been applied and also a lot of Delphi 2 and Delphi 3 extensions have
  117. been implemented. GNU Pascal is at version 2.7.2 (but this numbering is
  118. not really an indication, it follows the GNU
  119. C numbering, since it is a derivation of it)</DD>
  120. <DT><B>Operating systems:</B></DT>
  121. <DD>Free pascal runs on a limited number of systems : DOS, Win32, Linux,
  122. OS/2 and AmigaOS and is for the moment limited to the Intel and Motorola
  123. architectures. GNU Pascal runs basically on any system that can run GNU C.
  124. </DD>
  125. <DT><B>Sources:</B></DT>
  126. <DD>Free Pascal is entirely written in Pascal (about 4 Mb of source code),
  127. while GNU Pascal is written in C (it's an adaptation of the GNU C compiler
  128. : 2.8 Mb code + 8 MB of GNU C code)</DD>
  129. <DT><B>Language:</B></DT>
  130. <DD>Free Pascal supports the Borland Pascal dialect Borland, and implements
  131. the Delphi Object PAscal language. GNU Pascal supports ISO 7185, ISO 10206,
  132. (most of) Borland Pascal 7.0</DD>
  133. <DT><B>Extensions:</B></DT>
  134. <DD>Free Pascal implements function overloading, and operator overloading).
  135. GNU Pascal implements operator overloading.</DD>
  136. <DT><B>License:</B></DT>
  137. <DD>Both compilers come under the GNU GPL.</DD>
  138. <DT><B>Author:</B></DT>
  139. <DD>Free Pascal was started by Florian Klaempfl, Germany ([email protected]),
  140. GNU Pascal was started by Jukka Virtanen, Finland, ([email protected]).</DD>
  141. </DL>
  142. <A NAME="WhereToGetFP"></A>
  143. <H3><LI>Where can I get the compiler ?</LI></H3>
  144. <P>
  145. Free Pascal is available for download from all <A HREF="http://www.freepascal.org/download.html"> official mirrors</A>
  146. </P>
  147. <A NAME="PortabilityTips"></A>
  148. <H3><LI>What are the considerations in porting
  149. code to other processors?</A></H3>
  150. <P>
  151. Because the compiler now supports processors other than the Intel, it is
  152. important to take a few precautions so that your code will execute
  153. correctly on all processors.
  154. <UL>
  155. <LI> Limit your use of asm statements unless it is time critical code</LI>
  156. <LI> Don't use the packed directive unless you know exactly what you are
  157. doing. Most processors require alignment of data, and using packed on
  158. objects,classes and records may break this requirement. If this is the
  159. case your code will simply crash on the target processors.</LI>
  160. <LI> Clean up at the end of your program, i.e close all files on exit,
  161. as some operating systems don't like it when some files are left opened. </LI>
  162. <LI> Try not to rely on the endian of the specific machines when doing
  163. arithmetic operations. Furthermore, reading and writing of binary data
  164. to/from files will probably require byte swaps across different endian
  165. machines (swap is your friend in this case) </LI>
  166. <LI> Try limiting your local variables in subroutines to 32K, as this
  167. is the limit of some processors, use dynamic allocation instead. </LI>
  168. <LI> Try limiting the size of parameters passed to subroutines to 32K,
  169. as this is the limit of some processors, use const or var parameters
  170. instead. </LI>
  171. </UL>
  172. </P>
  173. <A NAME="OOP"></A>
  174. <H3><LI>I tried to compile my Delphi code with the Free Pascal Compiler,
  175. it seems that it doesn't recognize the OOP.</LI></H3>
  176. <P>
  177. The compiler supports the Delphi OOP. There may be some bugs, of course,
  178. You should try the -S2, -Sd or -So switches (see the manuals for the
  179. meaning of these switches)
  180. </P>
  181. <A NAME="HOMEWORK"></A>
  182. <H3><LI>I have to write a program for homework. Can you help?</LI></H3>
  183. <P>
  184. No. Please, don't send us mail about homework, we are no teachers.
  185. The Free Pascal development team tries to give good support for the Free
  186. Pascal compiler and are trying to always reply to emails. If we get
  187. emails like this, this becomes harder and harder.
  188. </P>
  189. <A NAME="HowcanIbuildaunit"></A>
  190. <H3><LI>How can I build a unit?</LI></H3>
  191. <P>
  192. It works like in Turbo Pascal. The first keyword in the file must be
  193. UNIT (not case sensitive). The compiler will generate two files: <TT>XXX.PPU</TT>
  194. and <TT>XXX.O</TT>. The PPU file contains the interface information for
  195. the compiler and the O-file the machine code (an object file, whose precise
  196. structure depends on the assembler you used). To use this unit in another
  197. unit or program, you must include its name in the USES clause of your program.
  198. </P>
  199. <A NAME="TurboVision"></A>
  200. <H3><LI>Will Free Pascal support TV (Turbo Vision) in the future?</LI></H3>
  201. <P>
  202. A Turbo Vision port, called Free Vision, has progressed nicely lately. It's
  203. already very usable, we are even writing an IDE in it. Due to copyrights
  204. problem the FreeVision source code is not available at the moment. You can
  205. 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.
  206. </P>
  207. <A NAME="CompileSystemUnit"></A>
  208. <H3><LI>How can I compile the system unit ?</LI></H3>
  209. <P>
  210. To recompile the system unit, it is recommended to have GNU make installed.
  211. typing 'make' in the rtl source directory will then recompile all RTL units
  212. including the system unit.
  213. You may choose to descend into the directory of your OS (e.g. rtl/go32v2)
  214. and do a 'make' there.
  215. </P>
  216. <P>
  217. It is possible to do all this manually, but you need more detailed knowledge
  218. of the RTL tree structure for that.
  219. </P>
  220. <A NAME="Internalerror9999"></A>
  221. <H3><LI>I get an internal error 9999</LI></H3>
  222. <P>
  223. The latest versions of the Free Pascal Compiler come with a Error Handling
  224. routine which catches the segmentation fault, and lets the compiler exit
  225. gracefully. This is reported as an internal error 9999. <BR>
  226. Please try to reproduce the error and send <A HREF="http://www.freepascal.org/moreinfo.html">us</A>
  227. a bug report.<p>
  228. (For the curious, IE 9999 is not a specific bug. It is a safety measure which
  229. terminates if during compiling a certain condition is not met, which can be
  230. caused by several bugs. So if you report the bug, and get IE 9999 later in
  231. a different piece or part of sourcecode, it could be a completely different
  232. bug)
  233. </P>
  234. <A NAME="Howdoesfunctionoverloadingwork"></A>
  235. <H3><LI>How does function overloading work?</LI></H3>
  236. <P>
  237. function overloading is implemented, like in C++:
  238. </P>
  239. <PRE>
  240. procedure a(i : integer);
  241. begin
  242. end;
  243. procedure a(s : string);
  244. begin
  245. end;
  246. begin
  247. a('asdfdasf&quot;);
  248. a(1234);
  249. end.
  250. </PRE>
  251. <P>
  252. You must be careful. If one of your overloaded functions is in the interface
  253. part of your unit, then all overloaded functions must be in the interface
  254. part. If you leave one out, the compiler will complain with a 'This overloaded
  255. function can't be local' message. Overloaded functions must differ in their
  256. parameters, it's not enough if their return types are different.
  257. </P>
  258. <A NAME="HowToCallCFuncuntions"></A>
  259. <H3><LI>How can I call C functions ?</LI></H3>
  260. <P>
  261. C calling convention is implemented as follows: The compiler pushes
  262. the parameters from right to left, but the procedure has to clear the stack.
  263. For calling the C function strcmp declare the following:
  264. </P>
  265. <PRE>
  266. function strcmp(s1 : pchar;s2 : pchar) : integer;cdecl;external;
  267. Since 0.99.5, the older [C]; won't work!
  268. </PRE>
  269. <A NAME="DJGPP2support"></A>
  270. <H3><LI>When will Free Pascal use DJGPP 2.0 under DOS/Windows ?</LI></H3>
  271. <P>
  272. As of version 0.99.0 Free Pascal uses DJGPP 2.0. DJGPP v1.2 support has
  273. been removed since version FPC 0.99.8.
  274. </P>
  275. <A NAME="HowToUseGraph"></A>
  276. <H3><LI>How can I use the graph unit with Free Pascal ?</LI></H3>
  277. <P>
  278. Look at InitGraph.
  279. </P>
  280. <!---
  281. If you want to use the GRAPH unit, a VESA 1.2 compliant graphics
  282. card must be installed.
  283. -->
  284. <A NAME="IntegratedAssemblerSyntax"></A>
  285. <H3><LI>Integrated Assembler syntax</LI></H3>
  286. <P>
  287. The default assembler syntax (AT&amp;T style) is different from the
  288. one in Borland Pascal (Intel style).
  289. </P>
  290. <P>
  291. However, as of version 0.99.0, the
  292. compiler supports Intel style assembly syntax.
  293. See the documentation for more info on how to use different assembler styles.
  294. </P>
  295. <P>
  296. 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>
  297. 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>.
  298. The documentation also contains a chapter where the difference between
  299. the Intel and AT&amp;T style assembly is explained.
  300. </P>
  301. <P>
  302. Or you can use the convertor program at http://rcs.urz.tu-dresden.de/
  303. schoenfu/zip/asmtrans.zip.
  304. </P>
  305. <A NAME="HowToAccessDosMemory"></A>
  306. <H3><LI>How to access DOS memory / How to do graphics ?</LI></H3>
  307. <P>
  308. You can do like in TP, via absolute or mem, for larger blocks use the
  309. dosmemput/dosmemget routines in unit Go32
  310. </P>
  311. <A NAME="FPwithoutfpu"></A>
  312. <H3><LI>Free Pascal without a math coprocessor</LI></H3>
  313. <P>
  314. On the Intel version the emulator is automatically loaded by the compiler,
  315. the file is bin\emu387.
  316. </P>
  317. <PRE>
  318. SET GO32=EMU C:\PP\BIN\EMU387
  319. </PRE>
  320. <A NAME="AccessingMoreThan4MB"></A>
  321. <H3><LI>Accessing more than 4 megabytes</LI></H3>
  322. <P>
  323. By default Free Pascal allocates only 4 meg. If it just allocated all
  324. it could get, people running windows would have problems as Windows would
  325. increase the swap file size to give the program more memory on and on,
  326. until the swap file drive would be full.
  327. </P>
  328. <P>
  329. You can specify the size of the heap with -Chxxxx. The default value
  330. is -Ch4000000. Try -Ch10000000, provided you got enough swap space.
  331. </P>
  332. <P>
  333. However, the heap size doesn't really matter anymore, since the Heap
  334. is able to grow. That is, if you've used all available heap space, the
  335. program will try to get more memory from the OS, thus the heap is limited
  336. to the maximum amount of free memory provided by the OS.
  337. </P>
  338. <A NAME="accessioports"></A>
  339. <H3><LI>Access I/O ports</LI></H3>
  340. <P>
  341. If you're under DOS, you should use the <TT>outport*</TT> and <TT>inport*</TT>
  342. procedures of the go32 unit.
  343. </P>
  344. <P>
  345. Since version 0.99.8, the Port array is supported like in TP, as long as you
  346. use the ports unit in your program.
  347. </P>
  348. <A NAME="ImusingWin95"></A>
  349. <H3><LI>I'm using the Dos compiler under Windows 95</LI></H3>
  350. <P>
  351. There is a problem with the Dos compiler and Win 95 on computers with less
  352. than 16 MB. First set in the properties of the DOS box the DPMI memory
  353. size to max value. Now try to start a demo program in the DOS box, e.g.
  354. HELLO (starting takes some time). If this works you will be able to get
  355. the compiler to work by recompiling it with a smaller heap size, perhaps
  356. 2 or 4 MB (option -Chxxxx).
  357. </P>
  358. <A NAME="ImusingOS2"></A>
  359. <H3><LI>I'm using OS/2</LI></H3>
  360. <P>
  361. Problems have been reported that the Go32v2 compiler does not run on
  362. some OS/2 installations. You can use the native OS/2 compiler, or compile
  363. a GO32V1 compiler yourself.
  364. </P>
  365. <A NAME="dpmi"></A>
  366. <H3><LI>INSTALL.EXE of Dos version 0.99.10 reports "Load error: no DPMI"</LI></H3>
  367. <p>
  368. The file cwsdpmi.exe is missing in the main directory of the zip archive.
  369. The above message pops up of no other DPMI services are available.
  370. Such services are for example available in a Dos window of Windows.
  371. You can either extract that file from basego32.zip or download it from
  372. <a href="http://www.brain.uni-freiburg.de/~klaus/cwsdpmi.exe">
  373. http://www.brain.uni-freiburg.de/~klaus/cwsdpmi.exe</a>.
  374. Put it into the same directory as install.exe and run install again.
  375. </p>
  376. <A NAME="winnt"></A>
  377. <H3><LI>INSTALL.EXE of Dos version 0.99.10 does not run in Windows NT</LI></H3>
  378. <p>
  379. This is an incompatibility of the mouse driver.
  380. Use this new version of install.exe instead:
  381. <a href="ftp://ftp.freepascal.org/pub/fpc/snapshot/install.exe">
  382. ftp://ftp.freepascal.org/pub/fpc/snapshot/install.exe</a>
  383. </p>
  384. <A NAME="snapshot"></A>
  385. <H3><LI>I want a new version NOW</LI></H3>
  386. <p>
  387. In the time between the release of new official versions, you
  388. can have a look at and test developer versions.
  389. Be warned though: this is work under progress, so in addition to
  390. old bugs fixed and new features added, this may also contain new bugs.
  391. The snapshot is generated automatically each night from the current
  392. source at that moment. Somethimes this may fail due to bigger changes
  393. not yet fully implemented. If your version doesn't work, try again one
  394. or two days later. Don't download the Go32V1 version for Dos, it's not
  395. supported any more.
  396. </p>
  397. <p>The latest snapshot can be downloaded from the
  398. <a href="http://www.freepascal.org/develop.html#snapshot">development</a> web page.
  399. </p>
  400. <p>
  401. To install a snapshot, extract the zip archive into the existing
  402. program directory of the last official version of fee pascal (after
  403. making a backup of the original of course). Or extract it into an
  404. empty directory, then move the files to the program directory,
  405. overwriting existing files. Make sure that you extract the ZIP archiv
  406. such that the included directory structure remains intact, for example
  407. if you use PKUNZIP, use "pkuzip -d" instead of just "pkunzip".
  408. </p>
  409. <A NAME="ideinst"></A>
  410. <H3><LI>Where can I find a text mode IDE for Dos</LI></H3>
  411. <p>
  412. The development of the IDE (integrated development environment)
  413. is not yet finished. However a working test version of the IDE is available
  414. as snapshot. It requires the latest compiler snapshot be installed on
  415. top of the last official Dos version 0.99.12 for Go32V2. So if you
  416. have not already done it, first install the last official
  417. version (file dos09912.zip or dos09912full.zip, you find these in
  418. the <a href="http://www.freepascal.org/download.html">download</a> section).
  419. Then get and extract the latest Dos snapshot for DOS-GO32V2 (snapshot.zip)
  420. into the directory containing the last official version.
  421. Then do the same with one of the IDE snapshots (the debugger does not
  422. work very well yet, so start with the version "IDE with compiler").
  423. For more details on where to find and how to install a snapshot,
  424. please see the previous FAQ item. For additional instructions
  425. for required IDE configuration please also read the next FAQ item.
  426. </p>
  427. <A NAME="ideconfig"></A>
  428. <H3><LI>How do I configure the Dos IDE</LI></H3>
  429. <p>
  430. Once you have installed the IDE (see the previous FAQ item),
  431. it requires two configuration changes before it can compile.
  432. This is due to the fact that the IDE includes its own compiler,
  433. it does not use ppc386.exe and thus it also does not use the
  434. configuration in the file ppc386.cfg. Thus if you try to compile,
  435. you get an error message telling that it can not compile
  436. the system unit. To fix this start fp.exe, select from the
  437. menu Compile, then Target then Go32V2. Next select the menu
  438. Options/Directories and in the line "Unit directories" enter the path
  439. to your copy of the rtl directory, usually c:\pp\units\go32v2\rtl.
  440. If you have done everything correct and it still doesn't work,
  441. you may have grabbed a snapshot that has a bug, in this case
  442. try again one or two days later.
  443. </p>
  444. <A NAME="binariesbig"></A>
  445. <H3><LI>Why are the generated binaries so big?</LI></H3>
  446. <p>
  447. There are several reasons and remedies for this.
  448. <ol>
  449. <li>If you are using 0.99.12: Due to some problems with the binary writer, the 0.99.12 and fixes weren't
  450. released with smartlinking RTLs. Smartlinking causes only actually used procedures,
  451. functions and constants to be linked in.<br>
  452. You can remedy this by using a development version and creating a smartlinking
  453. RTL. See the <a href="http://www.freepascal.org/makecyc.html">make cycle faq</a> or use a later release if available.</li>
  454. <lI>Generating debug code (-g options) is enabled. Use the strip utility
  455. (or stripw for the windows platform) to remove the debuginformation.<br>
  456. The utility is supplied with the releases, except under Linux were it is part
  457. of the GNU binutils package.</li>
  458. <lI>Under Dos(Go32V2) and windows targets you can use UPX to pack the .EXEs (just like e.g. pklite).
  459. The architecture of linux doesn't allow binary packing.</li>
  460. <lI>You can use LXLITE for packing EMX binaries, but you won't be able to run
  461. them under DOS any more then. It might even not be possible to use them
  462. on lower OS/2 versions (like 2.x) depending on chosen type of compression.</li>
  463. <li>Turning on optimalisations, both for supplied packages (RTL,API,FV,FCL) as for
  464. your own code, will also decrease code-size. </li>
  465. </ol>
  466. </p>
  467. <A NAME="systemnotfound"></A>
  468. <H3><LI>Unit system, syslinux or syswin32 not found errors</LI></H3>
  469. <p>
  470. System (syslinux, syswin32 depending on platform) is Pascal's base unit which is invisibly used
  471. in all programs. This unit defines several standard procedures and structures, and must
  472. be found to be able to compile any pascal program by FPC.<p>
  473. The location of the system.ppu and syslinux.o files are determined by the -Fu
  474. switch which can be specified commandline, but is usually in the ppc386.cfg
  475. (Win32: ppc386w.cfg) configuration file.<br>
  476. If the compiler can't find this unit there are three possible causes:
  477. <ol>
  478. <lI>The ppc386.cfg isn't in the same path as the compiler (go32v2 and win32),
  479. or in /etc/ppc386.cfg or as .ppc386.cfg in your homedirectory (Linux). </li>
  480. <li>The ppc386.cfg doesn't contain the -Fu line, or a wrong one.
  481. See the <a href="http://www.freepascal.org/makecyc.html">make cycle faq</a> specially the chapters
  482. about the ppc386.cfg and the directory structure.</li>
  483. <li>The files ARE found but the wrong version or platform. Correct ppc386.cfg to
  484. point to the right versions, or reinstall the right versions.</li>
  485. </ol>
  486. A handy trick can be executing &quot;ppc386 programname -vt&quot;, this shows
  487. where the compiler is currently looking for the system unit's files. You might
  488. want to pipe this through more(dos,windows) or less(Linux), since it can generate
  489. more than one screen information:
  490. <pre>
  491. Dos,Windows:<br>
  492. ppc386 programname -vt |more<br>
  493. Linux:<br>
  494. ppc386 programname -vt |less<br>
  495. </pre>
  496. </p>
  497. </ol>
  498. </HTML>