-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfaq.adp
1817 lines (1485 loc) · 94.7 KB
/
faq.adp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<master>
<property name="title"><trn key="website.faq.title" locale="en_US">Free Pascal - Knowledge base</trn></property>
<property name="entry">faq</property>
<property name="header"><trn key="website.FAQ_kbase" locale="en_US">FAQ / Knowledge base</trn></property>
<trn key="website.faq_intro" locale="en_US" locale="en_US">
<p>This document gives last minute information regarding the compiler. Furthermore,
it answers frequently asked questions and gives solutions to common problems
found with Free Pascal. The information presented herein always supersedes those
found in the Free Pascal documentation.
</trn>
<trn key="website.for_comprehensive" locale="en_US">
<p> For more comprehensive information on the pascal language, and the runtime library
calls, consult the Free Pascal manuals. Topics covered in this document :
</trn>
<OL>
<li><trn key="website.General_information" locale="en_US">General information</trn>
<OL>
<li><a href="#WhatIsFP"><trn key="website.q_What_is_FPC" locale="en_US">What is Free Pascal (FPC)?</trn></a>
<li><a href="#versions"><trn key="website.q_What_versions_exist" locale="en_US">Which versions exist, and which one should I use?</trn></a>
<li><a href="#FPandGNUPascal"><trn key="website.q_FPC_vs_GPC" locale="en_US">Free Pascal and GNU Pascal - a comparison</trn></a>
<li><a href="#general-license"><trn key="website.q_Licence_copyright_info" locale="en_US">License and copyright information</trn></a>
<li><a href="#WhereToGetFP"><trn key="website.q_Getting_the_compiler" locale="en_US">Getting the compiler</trn></a>
<li><a href="#general-install"><trn key="website.q_Installation_hints" locale="en_US">Free Pascal installation hints</trn></a>
<li><a href="#ftpproblems"><trn key="website.q_Why_username_password_for_download" locale="en_US">Why do i have to supply a user name and password to get Free Pascal ?</trn></a>
<li><a href="#general-connectftp"><trn key="website.q_Access_denies_while_download" locale="en_US">Access denied error when connecting to the Free Pascal FTP site</trn></a>
<li><a href="#snapshot"><trn key="website.q_Wanna_new_version_now" locale="en_US">I want a new version NOW</trn></a>
<li><a href="#installsnap"><trn key="website.q_Installing_snapshot" locale="en_US">Installing a snapshot</trn></a>
<li><a href="#HOMEWORK"><trn key="website.q_Homework" locale="en_US">I have to write a program for homework. Can you help?</trn></a>
<li><a href="#windowsapp"><trn key="website.q_Real_windows_application" locale="en_US">How do I make a real Windows application with windows and menu bars?</trn></a>
<li><a href="#game"><trn key="website.q_Game_in_FPC" locale="en_US">How do I make a game with Free Pascal? Can I make a game like Doom 3?</trn></a>
<li><a href="#ErrorPos"><trn key="website.q_Crash_analysis" locale="en_US">Getting more information when an application crashes</trn></a>
<li><a href="#general-doesntfindfiles"><trn key="website.q_Compiler_skips_files" locale="en_US">Compiler seems to skip files in directories -Fu points to</trn></a>
<li><a href="#binariesbig"><trn key="website.q_Big_binaries" locale="en_US">Why are the generated binaries so big?</trn></a>
<li><a href="#runerror"><trn key="website.q_Runtime_errors" locale="en_US">Runtime errors</trn></a>
<li><a href="#stdunits"><trn key="website.q_Standard_units" locale="en_US">Standard units</trn></a>
<li><a href="#debugsmart"><trn key="website.q_Debug_smartlinked" locale="en_US">Debugging smartlinked code does not fully work</trn></a>
<!--
<li><a href="#debugshared"><trn key="website.q_Debugging_DLL" locale="en_US">Debugging shared library (dynamic linked library) code does not fully work</trn></a>
-->
<li><a href="#cantfindunit"><trn key="website.q_Cannot_compile_with_bin_unit" locale="en_US">Cannot compile a program using a binary-only version of a unit</trn></a>
<li><a href='#isoxpascal'><trn key="website.q_isoxpascal" locale="en_US">Will you support ISO Extended Pascal?</trn></a>
<li><a href="#dotnet"><trn key="website.q_What_about_dotNET" locale="en_US">What about .NET?</trn></a>
</OL>
<li><trn key="website.Pascal_lang_rel_inf" locale="en_US">Pascal language related information</trn>
<OL>
<li><a href="#PortingCPU"><trn key="website.q_porting_CPU" locale="en_US">Considerations in porting code to other processors</trn></a>
<li><a href="#PortingOS"><trn key="website.q_porting_OS" locale="en_US">Considerations in porting code to other operating systems</trn></a>
<li><a href="#OOP"><trn key="website.q_OOP" locale="en_US">Compiling Delphi code using Free Pascal</trn></a>
<li><a href="#HowcanIbuildaunit"><trn key="website.q_build_unit" locale="en_US">Building a unit</trn></a>
<li><a href="#CompileSystemUnit"><trn key="website.q_compiling_systemunit" locale="en_US">Compiling the system unit</trn></a>
<li><a href="#Howdoesprocedureoverloadingwork"><trn key="website.q_how_does_proc_overloading_work" locale="en_US">How does function overloading work?</trn></a>
<li><a href="#HowToCallCFuncuntions"><trn key="website.q_calling_C_functions" locale="en_US">Calling C functions</trn></a>
<li><a href="#IntegratedAssemblerSyntax"><trn key="website.q_integrated_assembler_syntax" locale="en_US">Integrated Assembler syntax</trn></a>
<li><a href="#systemnotfound"><trn key="website.q_system_not_found" locale="en_US">Unit system not found errors</trn></a>
<li><a href="#extensionselect"><trn key="website.q_extenstion" locale="en_US">There is a new language extension that would be really useful. Will you include it?</trn></a>
</OL>
<li><trn key="website.RTL_rel_inf" locale="en_US">Runtime library related information</trn>
<OL>
<!--
<li><a href="#HowToUseGraph"><trn key="website.q_using_graph" locale="en_US">Using the graph unit with Free Pascal</trn></a>
-->
<li><a href="#WrongColors"><trn key="website.q_wrong_colours_using_graph" locale="en_US">Why do I get wrong colours when using the graph unit?</trn></a>
<li><a href="#fileshare"><trn key="website.q_filesharing" locale="en_US">File sharing and file locks</trn></a>
<li><a href="#filemode"><trn key="website.q_File_denied_errors" locale="en_US">File denied errors when opening files with reset</trn></a>
</OL>
<li><trn key="website.Windows_rel_inf" locale="en_US">Windows-related information</trn>
<OL>
<li><a href="#win-release"><trn key="website.q_win_release" locale="en_US">Releasing software generated by the windows compiler</trn></a>
<li><a href="#win-debugging"><trn key="website.q_win_debugging" locale="en_US">Debugging</trn></a>
<li><a href="#win-dll"><trn key="website.q_win_dll" locale="en_US">Dynamic libraries</trn></a>
<li><a href="#win-profile"><trn key="website.q_win_profile" locale="en_US">Profiling</trn></a>
<li><a href="#win-graph"><trn key="website.q_win_graph" locale="en_US">Graph and problems with keyboard, mouse and "dummy dos windows"</trn></a>
<li><a href="#win-cygwin"><trn key="website.q_win_cygwin" locale="en_US">Cygwin binary directory in your path sometimes causes builds to fail</trn></a>
<li><a href="#win95-fpc"><trn key="website.q_win95_fpc" locale="en_US">Using the DOS compiler under Windows 95</trn></a>
<!--
<li><a href="#win-os2"><trn key="website.q_win_os2" locale="en_US">Using OS/2 generated applications under Windows</trn></a>
-->
<li><a href="#win-dos"><trn key="website.q_win_dos" locale="en_US">Using DOS generated applications under windows</trn></a>
<li><a href="#win-ide-mouse"><trn key="website.q_win_ide_mouse" locale="en_US">The mouse cursor does not respond in the Windows IDE</trn></a>
</OL>
<li><trn key="website.UNIX_rel_inf" locale="en_US">UNIX-related information</trn>
<OL>
<li><a href="#unix-release"><trn key="website.faq.unix.release" locale="en_US">Releasing software generated by the UNIX compilers</trn></a>
<li><a href="#unix-debugging"><trn key="website.faq.unix.debugging" locale="en_US">Debugging</trn></a>
<li><a href="#unix-dll"><trn key="website.faq.unix.dll" locale="en_US">Dynamic libraries</trn></a>
<li><a href="#unix-profile"><trn key="website.faq.unix.profile" locale="en_US">Profiling</trn></a>
<li><a href="#libci386"><trn key="website.faq.libci386" locale="en_US">Libc is missing on platforms other than i386</trn></a>
<li><a href="#vgamissing"><trn key="website.faq.vgamissing" locale="en_US">Why can't the linker find "vga"?</trn></a>
<li><a href="#unix-asldmissing"><trn key="website.faq.unix.asldmissing" locale="en_US">Compiler indicates missing as and ld</trn></a>
<li><a href="#unix-ld219"><trn key="website.faq.unix.ld219" locale="en_US">link.res syntax error, or "did you forget -T?"</trn></a>
</OL>
<li><trn key="website.OS2_rel_inf" locale="en_US">OS/2-related information</trn>
<OL>
<li><a href="#os2-release"><trn key="website.faq.os2.release" locale="en_US">Releasing software generated by the OS/2 compiler</trn></a>
<li><a href="#os2-debugging"><trn key="website.faq.os2.debugging" locale="en_US">Debugging</trn></a>
<li><a href="#os2-dll"><trn key="website.faq.os2.dll" locale="en_US">Dynamic libraries</trn></a>
<li><a href="#os2-profile"><trn key="website.faq.os2.profile" locale="en_US">Profiling</trn></a>
<li><a href="#os2-dos"><trn key="website.faq.os2.dos" locale="en_US">Using DOS generated applications under OS/2</trn></a>
<li><a href="#instal106os2"><trn key="website.faq.os2.instal106os2a" locale="en_US">INSTALL.EXE of version 1.0.6 or below returns an unknown error (-1) under OS/2</trn></a>
<br><trn key="website.faq.os2.instal106os2or" locale="en_US">or</trn><br>
<a href="#instal106os2"><trn key="website.faq.os2.instal106os2" locale="en_US">INSTALL.EXE of version 1.0.6 or above complains about missing TZ variable under OS/2</trn></a>
<li><a href="#os2-fp"><trn key="website.faq.os2.fp" locale="en_US">OS/2 compiler not working after upgrading to 1.9.6 or newer</trn></a>
<li><a href="#os2-as-failing"><trn key="website.faq.os2.failing" locale="en_US">Compilation under OS/2 fails with error "Can't call the assembler"</trn></a>
</OL>
<li><trn key="website.DOS_rel_inf" locale="en_US">DOS-related information</trn>
<OL>
<li><a href="#dos-release"><trn key="website.q_dos_release" locale="en_US">Releasing software generated by the DOS compiler</trn></a>
<li><a href="#dos-debugging"><trn key="website.q_debugging" locale="en_US">Debugging</trn></a>
<li><a href="#dos-dll"><trn key="website.q_dynamic_libraries" locale="en_US">Dynamic libraries</trn></a>
<li><a href="#dos-profile"><trn key="website.q_profiling" locale="en_US">Profiling</trn></a>
<li><a href="#FPwithoutfpu"><trn key="website.q_fpwithoutfpu" locale="en_US">Running Free Pascal without a math coprocessor</trn></a>
<li><a href="#fp386"><trn key="website.q_app_crash_on_386" locale="en_US">Applications created with Free Pascal crash on 80386 systems</trn></a>
<li><a href="#nomousegraph"><trn key="website.q_no_mouse_graph_mode" locale="en_US">The mouse cursor is not visible in graphics screens</trn></a>
<li><a href="#accessioports"><trn key="website.q_accessing_io_ports" locale="en_US">Accessing I/O ports</trn></a>
<li><a href="#HowToAccessDosMemory"><trn key="website.q_accessing_dosmem" locale="en_US">Accessing DOS memory / Doing graphics programming</trn></a>
<li><a href="#dos-stack"><trn key="website.q_change_dos_stacksize" locale="en_US">Changing the default stack size</trn></a>
<!--
<li><a href="#dos-os2"><trn key="website.q_os2_apps_under_dos" locale="en_US">Using OS/2 generated applications under DOS</trn></a>
-->
</OL>
<!--
<li><trn key="website.BeOS_related_information" locale="en_US">BeOS-related information</trn>
<OL>
<li><a href="#beos-release"><trn key="website.faq.beos.release" locale="en_US">Releasing software generated by the BeOS compiler</trn></a>
<li><a href="#beos-debugging"><trn key="website.faq.beos.debugging" locale="en_US">Debugging</trn></a>
<li><a href="#beos-dll"><trn key="website.faq.beos.dll" locale="en_US">Dynamic libraries</trn></a>
<li><a href="#beos-profile"><trn key="website.faq.beos.profile" locale="en_US">Profiling</trn></a>
<li><a href="#beos-linking"><trn key="website.faq.beos.linking" locale="en_US">BeOS linking problems</trn></a>
</OL>
-->
<!--
<li><trn key="website.Amiga_tel_inf" locale="en_US">Amiga-related information</trn>
<OL>
<li><a href="#amiga-release"><trn key="website.faq.amiga.release" locale="en_US">Releasing software generated by the Amiga compiler</trn></a>
<li><a href="#amiga-debugging"><trn key="website.faq.amiga.debugging" locale="en_US">Debugging</trn></a>
<li><a href="#amiga-dll"><trn key="website.faq.amiga.dll" locale="en_US">Dynamic libraries</trn></a>
<li><a href="#amiga-profile"><trn key="website.faq.amiga.linking" locale="en_US">Profiling</trn></a>
</OL>
<li><trn key="website.PalmOS_rel_inf" locale="en_US">PalmOS-related information</trn>
<OL>
<li><a href="#palmos-release"><trn key="website.faq.palmos.release" locale="en_US">Releasing software generated by the PalmOS compiler</trn></a>
<li><a href="#palmos-debugging"><trn key="website.faq.palmos.debug" locale="en_US">Debugging</trn></a>
<li><a href="#palmos-dll"><trn key="website.faq.palmos.dll" locale="en_US">Dynamic libraries</trn></a>
</OL>
-->
</OL>
<OL>
<li><h2><trn key="website.General_Information" locale="en_US">General information</trn></h2>
<OL>
<li><a name='WhatIsFP'></a>
<h3><trn key="website.q_What_is_FPC" locale="en_US">What is Free Pascal (FPC)?</trn></h3>
<trn key="website.a_What_is_FPC" locale="en_US">
<p>Originally named FPK-Pascal, the Free Pascal compiler is a 16, 32
and 64 bit Turbo Pascal and Delphi compatible Pascal compiler for
Linux, Windows, OS/2, FreeBSD, Mac OS X, DOS and
several other platforms (the number of supported targets grows
all the time, although not all of them are on the same level as
the main ones).
<p>The Free Pascal compiler is available for several
architectures: x86 (16, 32 and 64 bit), ARM, PowerPC (32 and 64 bit),
SPARC (v8, v9), Java Virtual Machine (under development) and MIPS (little and big endian, under development).
An older version (the 1.0 series) and current development versions also supported m68k.
<p>The compiler is written in Pascal and is able to compile its
own sources. The source files are distributed under the GPLv2+ and included.
<p>Short history:
<ul>
<li>06/1993: project start
<li>10/1993: first small programs work
<li>03/1995: the compiler compiles its own sources
<li>03/1996: released on the Internet
<li>07/2000: 1.0 released
<li>12/2000: 1.0.4 released
<li>04/2002: 1.0.6 released
<li>07/2003: 1.0.10 released
<li>05/2005: 2.0.0 released
<li>12/2005: 2.0.2 released
<li>08/2006: 2.0.4 released
<li>09/2007: 2.2.0 released
<li>08/2008: 2.2.2 released
<li>04/2009: 2.2.4 released
<li>12/2009: 2.4.0 released
<li>11/2010: 2.4.2 released
<li>05/2011: 2.4.4 released
<li>01/2012: 2.6.0 released
<li>02/2013: 2.6.2 released
<li>03/2014: 2.6.4 released
<li>11/2015: 3.0.0 released
<li>02/2017: 3.0.2 released
<li>11/2017: 3.0.4 released
<li>06/2020: 3.2.0 released
<li>05/2021: 3.2.2 released
</ul>
</trn>
<li><a name='versions'></a>
<h3><trn key="website.q_What_versions_exist" locale="en_US">Which versions exist, and which one should I use?</trn></h3>
<trn key="website.a_What_versions_exist" locale="en_US">
<p>The latest official version is 3.2.2, the first minor update in the 3.2.x series.
New development is performed in the 3.3.x series, which will eventually
be released as 3.4.0 or 4.0.0, depending on milestones achieved.
<h4>Historic versions</h4>
<p>FPC's version numbering changed a few times over the years. Pre-1.0 versioning information has been
moved to the <a href="http://wiki.freepascal.org/1.0_versioning">Wiki 1.0 versioning article.</a>
<h4>Modern versioning</h4>
<p>With the release of 1.0, the version numbering was
slightly changed to a system resembling one used for the Linux
kernels.
<p>
<ul>
<li>Releases that only fix bugs in version 1.0 are numbered 1.0.x.
<li>Post-1.0 development (the so called snapshots) have version number
1.1.x.
<li>Eventually the 1.1.x versions, when stabilized, were released
as the 2.0.x series, preceded by betas marked as 1.9.x. Fixes to the
2.0 release were numbered 2.0.x, fixes to the 2.2 release 2.2.x, fixes to the 2.4 release as 2.4.x etc</li>
<li>The new development version after the 2.4.0 release was numbered 2.5.x
and so on.
<li>Repackagings that affect sources are indicated with a single letter as
suffix (e.g. 2.0.4a). This is usually the case for platforms that weren't part of the original release round.
<li>The stable branch (currently, fixes_3_0, previously fixes_2_6) always has an odd last number (2.6.1, 2.6.3 and 3.0.1).
Compilers with such versions are snapshots, and e.g. a snapshot with 2.6.1 can
be anywhere between 2.6.0 and the moment 2.6.2 branched off (Jan 2013). Likewise,
after the release of 2.6.2 the fixes_2_6 branch identified itself as version 2.6.3 till 2.6.4 branched off (typically
two months before its release). After 2.6.4, the stable branch's number was updated to 2.6.5,
after 3.0.2 to 3.0.3 etc.
</ul>
<p>
<p>Normally, you would want to use a release. Releases are considered
stable, and easier to support (the bugs, quirks and unintended
"features" are well known 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 (which are usually fixed by the next day).
<p>Development snapshots are often quite useful for certain categories of
users. Ask on the mailing lists if it is worth the trouble in your case if
you are not sure.
<p>Snapshots of the stable branch (fixes_3_2) are meant to test release engineering. They are
mainly interesting in the months before a release to extensively
test the branch from which the release is created.
<p>We advise all users to upgrade to the newest version for their
target (preferably the new stable 3.2.x series).
<p> A graphical timeline of the FPC project plus its near future would
be:
<img src="pic/timeline.png">
</trn>
<li><a name='FPandGNUPascal'></a>
<h3><trn key="website.q_FPC_vs_GPC" locale="en_US">Free Pascal and GNU Pascal - a comparison</trn></h3>
<trn key="website.a_FPC_vs_GPC" locale="en_US">
<DL>
<DT><b>Aim:</b>
<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.
<DT><b>Version:</b>
<DD>Currently, Free Pascal is at version 3.2.2 (May 2021). GNU Pascal is stopped
version 2.1 (from 2002, which can be built with several different GCC's as backend;
their Mac OS X version is an exception though, as it follows the GCC version number).</DD>
<DT><b>Tracking:</b>
<DD>Between releases, development versions of FPC are available through daily snapshots
and the source via SVN. GPC issues a set of patches to the last version a few times
a year, and there are regular snapshot for OS X and Windows, made by users.
<DT><b>Operating systems:</b>
<DD>Free Pascal runs on a large number of platforms,
inlcuding DOS (16/32-bit), Win32 (no UNIX porting layer needed), Linux, FreeBSD,
NetBSD, OS/2, BeOS, Mac OS X, on the following architectures:
x86 (32 and 64 bit),
SPARC, PowerPC (32 and 64 bit), ARM, Java Virtual Machine (under development), and
MIPS (under development).
GNU Pascal runs basically on any system that supported by GCC, and for which the build process was verified.
<DT><b>Bootstrapping:</b>
<DD>FPC requires a suitable set of binutils (AS, AR, LD) on some platforms, GNU make and a command line bootstrap compiler. New architectures/OSes are cross-compiled.
GPC bootstraps via a suitable version of GCC, and requires a full set of binutils, flex, bison, gmake, a POSIX shell and libtool
<DT><b>Sources:</b>
<DD>Free Pascal is entirely written in Pascal, while GNU Pascal is written in C (it's an adaptation of the GNU
C compiler)
<DT><b>Language:</b>
<DD>Free Pascal supports the Borland Pascal dialect,
implements the Delphi Object Pascal language, Objective-Pascal and has some support for ISO 7185 Pascal and Mac Pascal extensions.
GNU Pascal supports ISO 7185, ISO 10206 and (most of) Borland Pascal 7.0
<DT><b>Extensions:</b>
<DD>Free Pascal implements method, function and operator overloading (later Delphi versions have also added these, so strictly they are not extensions anymore)
GNU Pascal implements operator overloading.
<DT><b>License:</b>
<DD>Both compilers come under the GNU GPL.
<DT><b>Author:</b>
<DD>Free Pascal was started by Florian Klämpfl, Germany
(florian@freepascal.org), GNU Pascal was started by Jukka Virtanen,
Finland (jtv@hut.fi). </DD></DL><br>
</trn>
<li><a name='general-license'></a>
<h3><trn key="website.q_Licence_copyright_info" locale="en_US">License and copyright information</trn></h3>
<trn key="website.a_Licence_copyright_info" locale="en_US">
<p> Applications created by the compiler and using the runtime
library (RTL) come under a modified Library GNU Public License (LGPL).
This license does not impose any kind of license on the created applications. It is therefore possible to create closed source
or proprietary software using the Free Pascal Compiler.
<p>The following exception has been added to the LGPL variant
that applies to the FPC RTL:<p><I> As a special
exception, the copyright holders of this library give you
permission to link this library with independent modules to
produce an executable, regardless of the license terms of
these independent modules, and to copy and distribute the
resulting executable under terms of your choice, provided
that you also meet, for each linked independent module, the
terms and conditions of the license of that module. An
independent module is a module which is not derived from or
based on this library. If you modify this library, you may
extend this exception to your version of the library, but
you not obligated to do so. If you do not wish to do so,
delete this exception statement from your version.</I>
<p>Please note that you still have to comply to the LGPL as far as sources of the runtime library itself are concerned. This, for example,
requires you to provide the source code of the runtime library if a recipient of your application asks for it. If you want
to write proprietary closed source software, please comply with the following terms:
<ul>
<li>Most people can satisfy the source code requirement by mentioning
that the RTL source code can be downloaded at the Free Pascal
web site: if you did not modify the rtl this is considered adequate to
satisfy the LGPL requirement of providing source code.
<li>If you made modifications to the runtime library, you cannot keep them
for yourself, you must make them available if requested by recipients of your application.
<li>Distribute the modified LGPL license with your product, indicating to which parts of your application it applies (the FPC RTL).
</ul>
<p> The compiler source code, on the other hand, comes under
the GNU General Public License, which means that the compiler
source can only be used in software projects that are distributed
under a compatible license (or that are not distributed at all).
</trn>
<li><a name='WhereToGetFP'></a>
<h3><trn key="website.q_Getting_the_compiler" locale="en_US">Getting the compiler</trn></h3>
<trn key="website.a_Getting_the_compiler" locale="en_US">
<p>The latest official stable Free Pascal release is available for download
from all <a href="@maindir@download@x@">official mirrors</a>
</trn>
<li><a name='general-install'></a>
<h3><trn key="website.q_Installation_hints" locale="en_US">Free Pascal installation hints</trn></h3>
<trn key="website.a_Installation_hints" locale="en_US">
<ul>
<li> Do not install the compiler in a directory that has spaces
in its name, since some of the compiler tools do not like these
</ul>
</trn>
<li><a name='ftpproblems'></a>
<h3><trn key="website.q_Why_username_password_for_download" locale="en_US">Why do i have to supply a user name and password to get Free Pascal ?</trn></h3>
<trn key="website.a_Why_username_password_for_download" locale="en_US">
<p> You are trying to login to an ftp site. You have to use the login name
"anonymous" and your e-mail address as your password.
</trn>
<li><a name='general-connectftp'></a>
<h3><trn key="website.q_Access_denies_while_download" locale="en_US">Access denied error when connecting to the Free Pascal FTP site</trn></h3>
<trn key="website.a_Access_denies_while_download" locale="en_US">
<p>The Free Pascal main ftp site can only accept a maximum number of
simultaneous connections. If this error occurs, it is because
this limit has been reached. The solution is either to wait and
retry later, or better still use one of the Free Pascal mirror sites.
</trn>
<li><a name='snapshot'></a>
<h3><trn key="website.q_Wanna_new_version_now" locale="en_US">I want a new version NOW</trn></h3>
<trn key="website.faq.development.snapshot" locale="en_US">
<p>In the time between the release of new official versions, you can
have a look at and test developer versions (so-called "snapshots"). Be
warned though: this is work in progress, so in addition to old bugs
fixed and new features added, this may also contain new bugs.
<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 does not work, try again one or
two days later.
<p>The latest snapshot can always be downloaded from the <A
href="@maindir@develop@x@#snapshot">development</a>
web page.
</trn>
<li><a name='installsnap'></a>
<h3><trn key="website.q_Installing_snapshot" locale="en_US">Installing a snapshot</trn></h3>
<trn key="website.a_Installing_snapshot" locale="en_US">
<p>To install a snapshot, extract the zip archive into the existing
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.
</trn>
<li><a name='HOMEWORK'></a>
<h3><trn key="website.q_Homework" locale="en_US">I have to write a program for homework. Can you help?</trn></h3>
<trn key="website.a_Homework" locale="en_US">
<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.
</trn>
<li><a name="windowsapp"></a>
<h3><trn key="website.q_Real_windows_application" locale="en_US">How do I make a real Windows application with windows and menu bars?</trn></h3>
<trn key="website.a_Real_windows_application" locale="en_US">
The easiest way is to <a href='http://www.lazarus.freepascal.org'>download Lazarus</a>.
It won't be just a Windows application, it will also work under Linux, FreeBSD and
Mac OS X.
</trn>
<li><a name="game"></a>
<h3><trn key="website.q_Game_in_FPC" locale="en_US">How do I make a game with Free Pascal? Can I make a game like Doom 3?</trn></h3>
<trn key="website.a_Game_in_FPC" locale="en_US">
Yes, you can make games with Free Pascal and if you are really good you can make
a game like Doom 3. Making games is difficult, you need to be an experienced
programmer to make them. The web site <a href='http://www.pascalgamedevelopment.com'>
www.pascalgamedevelopment.com</a> is a community of people who program games in Free
Pascal and Delphi.
<p>
If you want a start, please start to study <a href='http://sourceforge.net/projects/jedi-sdl/'>JEDI-SDL</a>
or <a href='http://ptcpas.sourceforge.net'>PTCPas</a>. Also you can try to study an existing game, for example
<a href='http://www.lugato.net/thesheepkiller/'>The Sheep Killer</a> is a very simple game and it should not be
very hard to understand its code.
</trn>
<li><a name='ErrorPos'></a>
<h3><trn key="website.q_Crash_analysis" locale="en_US">Getting more information when an application crashes</trn></h3>
<trn key="website.a_Crash_analysis" locale="en_US">
<OL>
<li>The easiest possibility is to recompile 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 of the crash. To see runtime library (RTL)
functions in the backtrace with their real name, you have to recompile
the RTL with -gl too.
<li>For more comprehensive checking, compile the
program with debugging information (use the -g command line option)
<li>Load the program in the debugger <PRE>gdb --directory=<src dirs> myprog.exe</PRE>Notes:
<ul>
<li>Under UNIX systems (Linux, the BSD's), 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 (";") on Windows, or colons (":") on UNIX platforms. 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 <option1 option2 ...></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 on 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 *<address></PRE>For example:<PRE>info line *0x05bd8</PRE>
</OL>
</trn>
<li><a name='general-doesntfindfiles'></a>
<h3><trn key="website.q_Compiler_skips_files" locale="en_US">Compiler seems to skip files in directories -Fu points to</trn></h3>
<trn key="website.a_Compiler_skips_files" locale="en_US">
<p>This sometimes happens with installation/compilation scripts if the
copying command doesn't preserve dates. The object files get older than
the PPU file, and the compiler tries to recompile them. A simple <TT>touch</TT>
will solve it.
<p>
Also note that FPC, contrary to Turbo Pascal keeps track of include files. Modified
include files or duplicate names can trigger an attempt to recompile.
</trn>
<li><a name='binariesbig'></a>
<h3><trn key="website.q_Big_binaries" locale="en_US">Why are the generated binaries so big?</trn></h3>
<trn key="website.a_Big_binaries" locale="en_US">
There are several reasons and remedies for this:
<OL>
<li>
You can create smartlinked applications. 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
command line option when compiling a program.
<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 will not do
anything when compiling units)
<li>Turn on optimisations, both for supplied packages (RTL, FV, FCL)
and for your own code, this will also decrease the code size.
</OL>
Generally Free Pascal generates smaller binaries than modern competing compilers,
however, it does not hide code in large dynamic libraries. Free Pascal generates
larger binaries than compilers from long ago do. Large framework libraries result
in larger executables.
See also the <a href="http://wiki.freepascal.org/Size_Matters">Size Matters wiki entry</a>.
</trn>
<li><a name='runerror'></a>
<h3><trn key="website.q_Runtime_errors" locale="en_US">Runtime errors</trn></h3>
<trn key="website.a_Runtime_errors" locale="en_US">
<p> When an application generated by FPC terminates in an abnormal way,
it is very likely that a runtime error will be
generated. These errors have the form :
<PRE>
Runtime error 201 at $00010F86
$00010F86 main, line 7 of testr.pas
$0000206D
</PRE>
<p> The 201 in this case indicates the runtime error
number. The definition of the different runtime error numbers is
described in the Free Pascal user's manual, Appendix D. The
hexadecimal numbers represent the addresses on the call stack when the error occured.
</trn>
<li><a name='stdunits'></a>
<h3><trn key="website.q_Standard_units" locale="en_US">Standard units</trn></h3>
<trn key="website.a_Standard_units" locale="en_US">
<p> To see the list of base units supplied with Free Pascal, and
on which platform they are supported, consult the Free Pascal user's manual.
There is also a short description of what each unit does in the same section
of the manual.
</trn>
<!--
<li><a name='internaldocs'></a>
<trn key="website.faq.internaldocs" locale="en_US">
<h3>How does the compiler work internally?</h3>
<p>A draft document describing the internals of the Free Pascal compiler is
available <a href="ftp://ftp.freepascal.org/pub/fpc/docs/fpc-int10.zip">here</a>.
</trn>
-->
<li><a name='debugsmart'></a>
<h3><trn key="website.q_Debug_smartlinked" locale="en_US">Debugging smartlinked code does not fully work</trn></h3>
<trn key="website.a_Debug_smartlinked" locale="en_US">
<p>Debugging smart linked code might not work correctly. This is
due to the fact that no type information is emitted for
smartlinked code. If this would not be done, the files
would become enormous.
<p> While debugging, it is not recommended to use the
smartlinking option.
</trn>
<!--
<li><a name=debugshared></a>
<h3><trn key="website.q_Debugging_DLL" locale="en_US">Debugging shared library (dynamic linked library) code does not fully work</trn></h3>
<trn key="website.a_Debugging_DLL" locale="en_US">
<p>Debugging shared libraries (or dynamic linked libraries) produced
by the Free Pascal compiler is not officially supported.
</trn>
-->
<li><a name='cantfindunit'></a>
<h3><trn key="website.q_Cannot_compile_with_bin_unit" locale="en_US">Cannot compile a program using a binary-only version of a unit</trn></h3>
<trn key="website.a_Cannot_compile_with_bin_unit" locale="en_US">
<p>
Sometimes, even though there is a binary version of a module (unit file and object file)
available, the compiler claims it cannot find the unit This can be caused either by an
incompatibility in the PPU file format (which can change across
compiler versions), or by a change in one of the units of the RTL
that has changed in between releases.
<p>
To get more information, compile the code using the -vtu (show tried and used unit information)
compiler switch, and the unit loading phase will be displayed. You might
discover that the unit being loaded requires to be recompiled because one
of the unit it uses has changed.
<p>If you plan on distributing a module without the source code, the binaries
should be compiled and made available for all versions of the compiler you
wish to support, otherwise compilation errors are bound to occur.
</trn>
<li><a name='isoxpascal'></a>
<h3><trn key="website.q_isoxpascal" locale="en_US">Will you support ISO Extended Pascal?</trn></h3>
<trn key="website.a_isoxpascal" locale="en_US">
FPC's primary goal is to be a Turbo Pascal and Delphi-compatible compiler, and it also
supports a subset of the Mac-Pascal dialect and of Standard ISO Pascal. While in theory it would be possible
to add a complete ISO Standard or Extended Pascal modes, until now no people interested in
such functionality have stepped up to work on such features.
<p>
<a href="http://www.gnu-pascal.de/">GNU-Pascal</a> is however a modern compiler that can
compile ISO Extended Pascal. If you have any need for the ISO Extended Pascal dialect, we
recommend you to take a look at this compiler.
</trn>
<li><a name='dotnet'></a>
<h3><trn key="website.q_What_about_dotNET" locale="en_US">What about .NET?</trn></h3>
<trn key="website.a_What_about_dotNET" locale="en_US">
Occasionally, users ask about a FPC that supports .NET, or our
plans in that direction. <p>
Mainly the users are either interested because of .NET's
portability aspects (Mono is quoted over and over again), or
because it is supposed to be the next big thing in Windows
programming, and they think Windows programming will not be possible
in the future.<p>
While the FPC core developpers are somewhat interested out of
academic curiousity (mainly because it could be a pilot for a
generalized backend creating bytecode) there are however several
problems with .NET in combination with FPC:
<OL>
<li>
Pascal is a language that uses pointers, and existing codebases
can only be unmanaged. Unmanaged code is not portable under .NET,
so that already kills most possible benefits. This also means that
existing FPC and Delphi code won't run on .NET. There are more
such little language problems.</li>
<li>FPC's libraries are not based on .NET classes and data models (and
cannot be changed to do so without effectively rewriting them),
moreover the libraries could only be unmanaged too, or they
would be incompatible</li>
<li>There is nothing <em>practical</em> known yet about how portable
an average .NET program will be. Little experiments with hello
world level code mean nothing, that kind of code works with
nearly any language. A good test would be to see existing non trivial
codebases run unmodified under mono, that were not designed with mono
in mind. Just like we try to do for
Delphi</li>
<li> The fact that on Windows 80% of the .NET code seems to be
ASP.NET does not help either. This makes porting existing code
less useful (since ASP.NET is tied to IIS), and new codebases of
portable code can be set in nearly every language </li>
<li>Operating System dependant code would not work anymore, since
the Win32/64 interface is unmanaged.
</OL> <p>
So effectively this means that for FPC to benefit from .NET you
would have to significantly adapt the language (thus compiler) and
libraries, and be incompatible with the existing native sourcecode.
Moreover
that also means that existing apps would have to be rewritten for
.NET, since it would take more than a simple recompile with a
FPC/.NET compiler.<p>
While unmanaged code has some uses (easier integration with managed
code inside Windows), this still requires writing a code generator and
defining interfaces and libraries. This means a <b>lot of work</b> and
since .NET take-up is not really high, this might not be worth it. <p>
However if a FPC user does the bulk of the work (e.g. a bytecode
codegenerator, and maybe some base libraries) and if the work is
suitable for inclusion in FPC (a very big if), we will of course
include it.<p>
Since support for <a href="http://wiki.freepascal.org/FPC_JVM">generating JVM bytecode</a> has been added to the
compiler, such a project may be more realistic now than it has been
in the past. Many of the caveats mentioned above still hold though:
language compatibility is not 100% and most standard units will have
to be reimplemented.<p>
</trn>
</OL>
<li><h2><trn key="website.Pascal_lang_rel_inf" locale="en_US">Pascal language related information</trn></h2>
<OL>
<li><a name='PortingCPU'></a>
<h3><trn key="website.q_porting_CPU" locale="en_US">Considerations in porting code to other processors</trn></h3>
<trn key="website.a_porting_CPU" locale="en_US">
<p>Because the compiler supports multiple processor architectures, it
is important to take a few precautions so that your code will execute
correctly on all processors.
<ul>
<li>Limit your use of asm statements unless it is time critical code
<li>Try not to rely on the endianness of the specific machines when performing operations depending on data layout. In particular, reading and writing binary data
to/from files will probably require byte swaps across different endianness
machines (swapendian is your friend in this case). Freepascal defines
<CODE>FPC_LITTLE_ENDIAN</CODE> or <CODE>FPC_BIG_ENDIAN</CODE> to indicate the
target endianness.
<li>Try limiting your local variables in subroutines to 32K, as this
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
where appropriate.
<li><TT>CPU16</TT>,<TT>CPU32</TT> or <TT>CPU64</TT> is defined indicating
whether the target is a 16-bit, 32-bit or 64-bit cpu. This can help with
incorporating 16-bit, 32-bit and 64-bit specific code.
<li>Use the <TT>ptruint</TT> type when declaring an ordinal that will store
a pointer, since pointers can be either 32-bit or 64-bit depending on
the processor and operating system. For 16-bit it is memory model dependent.
</ul>
</trn>
<p>
<li><a name='PortingOS'></a>
<h3><trn key="website.q_porting_OS" locale="en_US">Considerations in porting code to other operating systems</trn></h3>
<trn key="website.a_porting_OS" locale="en_US">
<p>Because the compiler supports several different operating systems,
is important to take a few precautions so that your code will execute
correctly on all systems.
<ul>
<li>File sharing is implemented differently on different operating
systems, so opening already opened files may fail on some operating
systems (such as Windows). The only correct way to make sure to
have the same file sharing behavior is to use the I/O routines
provided by the <TT>sysutils</TT> unit.
<li>Clean up at the end of your program, i.e. close all files on exit, and
release all allocated heap memory, as some operating systems do not like it
when some things are left allocated or opened.
<li> Some operating systems limit the stack space that can be allocated,
therefore it is important to limit subroutine nesting, and the number of
local variables. Limiting total stack space usage at a given moment to
at most 256 KBytes will make porting easier.
<li> Do not hardcode paths to files, try to use relative paths
instead
<li> Use the following constants (defined in the system unit)
to get information on files, line endings, and to build paths:
<ul>
<li> <TT>LineEnding</TT> : Indicates the characters which end a text line
<li> <TT>LFNSupport</TT> : Indicates if long filenames are supported (more than 8.3 characters)
<li> <TT>DirectorySeparator</TT> : The character or characters that separate path components
<li> <TT>DriveSeparator</TT> : The character that separates the drive specification from the rest
of the path
<li> <TT>PathSeparator</TT> : The character that separates directories in the path lists (such as the search path)
<li> <TT>FileNameCaseSensitive</TT> : Boolean indicating if the filenames for this system may be case-sensitive or not
<li> <TT>AllFilesMask</TT> : String containing a wildcard expression for all files
</ul>
It is also possible to use the <TT>PathDelim</TT>, <TT>PathSep</TT> and <TT>DriveDelim</TT> constants
defined in the <TT>sysutils</TT> unit.
</ul>
</trn>
<p>
<li><a name='OOP'></a>
<h3><trn key="website.q_OOP" locale="en_US">Compiling Delphi code using Free Pascal</trn></h3>
<trn key="website.a_OOP" locale="en_US">
<p>The compiler supports Delphi-style classes. Make sure you use the -S2 or
-Sd command line switches (see the manuals for the meaning of these switches), or add <tt>{$mode objfpc}</tt> or <tt>{$mode delphi}</tt> to your source code. For a
list of Delphi incompatibilities also check the manual.
</trn>
<li><a name='HowcanIbuildaunit'></a>
<h3><trn key="website.q_build_unit" locale="en_US">Building a unit</trn></h3>
<trn key="website.a_build_unit" locale="en_US">
<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> and <TT>XXX.O</TT>. The PPU file contains the interface
information for the compiler and the O-file the machine code (an 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.
</trn>
<li><a name='CompileSystemUnit'></a>
<h3><trn key="website.q_compiling_systemunit" locale="en_US">Compiling the system unit</trn></h3>
<trn key="website.a_compiling_systemunit" locale="en_US">
<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 including the system unit. You may choose to descend into
the directory of your OS (e.g. rtl/linux) and do a 'make' there.
<p>It is possible to do all this manually, but you need more detailed
knowledge of the RTL tree structure for that.
</trn>
<li><a name='Howdoesprocedureoverloadingwork'></a>
<h3><trn key="website.q_how_does_proc_overloading_work" locale="en_US">How does function overloading work?</trn></h3>
<trn key="website.a_how_does_proc_overloading_work" locale="en_US">
<p>Here is a procedure overloading example in FPC or ObjFPC mode:
<PRE>
procedure a(i : integer);
begin
end;
procedure a(s : string);
begin
end;
begin
a('asdfdasf');
a(1234);
end.
</PRE>
<p>You must be careful. If one of your overloaded functions is in the
interface part of your unit, then all overloaded functions must be in
the interface part. If you leave one out, the compiler will complain
with a 'This overloaded function can't be local' message. Overloaded
functions must differ in their parameters; it is not enough if only their
return types are different.
</trn>
<li><a name='HowToCallCFuncuntions'></a>
<h3><trn key="website.q_calling_C_functions" locale="en_US">Calling C functions</trn></h3>
<trn key="website.a_calling_C_functions" locale="en_US">
<p>
It is possible to call functions written in C and compiled
by the GNU C compiler (<TT>GCC</TT>). E.g., for calling the
C function strcmp, declare the following (the <tt>cint</tt> type is
declared in the <tt>ctypes</tt> unit):
<PRE>function strcmp(s1 : pchar;s2 : pchar) : cint;cdecl;external;</PRE>
</trn>
<li><a name='IntegratedAssemblerSyntax'></a>
<h3><trn key="website.q_integrated_assembler_syntax" locale="en_US">Integrated Assembler syntax</trn></h3>
<trn key="website.a_integrated_assembler_syntax" locale="en_US">
<p>The default assembler syntax (AT&T style) is different from the
one in Borland Pascal (Intel style). FPC however supports both styles.
See the documentation for more info on how to use
different assembler styles.
<p>A description of the AT&T syntax can be found in the GNU
Assembler documentation.
</trn>
<li><a name='systemnotfound'></a>
<h3><trn key="website.q_system_not_found" locale="en_US">Unit system not found errors</trn></h3>
<trn key="website.a_system_not_found" locale="en_US">
<p>System is Pascal's base unit and is implicitly used by 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>The location of the system and other unit files is passed on to the
compiler by the -Fu switch. This switch can be specified on the command line, but is usually located in the fpc.cfg configuration file.
<p>If the compiler cannot find this unit, there are three possible causes:
<OL>
<li>The fpc.cfg file is not in the same directory as the compiler
executable (msdos,go32v2, win32 and OS/2) or cannot be found as
"/etc/fpc.cfg" or ".fpc.cfg" in your homedirectory (UNIX platforms).
<li>The fpc.cfg file does not contain the -Fu parameter, or a wrong one.
See the <a href="http://www.stack.nl/~marcov/buildfaq.pdf">build faq (PDF)</a>, especially the chapters
about the fpc.cfg and the directory structure.
<li>The unit files ARE found, but are the wrong version or for a different platform. Correct
fpc.cfg to point to the right versions or reinstall the right
versions (this can e.g. happen if you try to use a <A
href="#snapshot">snapshot</a>
compiler while the -Fu statement in the used fpc.cfg still points to
the RTL that came with the official release compiler).
</OL>
<p>A handy trick can be executing "fpc programname -vtu". This will show
where the compiler is currently looking for the unit files. You
might want to pipe this through more (Dos, OS/2, Windows) or less
(UNIX), since it can generate more than one screen information:
<p>
<PRE>
Dos, OS/2, Windows: fpc programname -vt |more<br>
UNIX, Linux: fpc programname -vt |less<br>
</PRE>
<p>
</trn>
<li><a name='extensionselect'></a>
<h3><trn key="website.q_extenstion" locale="en_US">There is a new language extension that would be really useful. Will you include it?</trn></h3>
<TRN key="website.a_extenstion" locale="en_US">
Occasionally somebody asks for a new language extension on the maillist,
and the discussions that follow have a recurring pattern. An
extension is quite a big deal for the FPC team, and there are
some criteria that are used to select if an extension is
"worth" the trouble. The most important pre-selection criteria are:
<OL>
<li>Compatibility must not be compromised in any way. Existing
codebases on at least the Pascal level must keep
running. This is often more difficult than most people
think.
<li>The extension must have real value. Anything that is only
a shorter notation does not apply, unless it is
out of compatibility with an existing Pascal/Delphi
codebase. Practically it means it must make something
possible that cannot be done otherwise or be a compatibility
item
<li>The change must fit in with the scope of the project:
implementing a Pascal compiler with support for RAD
and a generic DB system. This excludes features like
inline SQL, and large garbage collected object frameworks.
</OL>
Exceptions to the second rule are sometimes made for
platform-specific reasons (e.g. interfacing to some other language or
OS). The first rule is often a problem, because issues are not
easily recognizable unless one has tried to make extensions
before. Best is to make a thoroughly written proposal that the
developers can review, including
<ul><li>an explanation of the feature
<li> why it is needed, what does it make possible?
<li> how you would implement it?
<li> many examples of typical use, and tests for possible problem
cases
</ul>
Try to be verbose and really try to view this from the viewpoint
of somebody who has to implement it, and try to make examples
that span multiple units and procedures, and review what happens.
Be critical, try to punch holes in your
own reasoning and find possible problematic cases, and document
them.
<p>
Besides these pre-selection rules and documentation, the other
important question is who is going to do the work. Keep in mind
that the FPC developers are volunteers with todo-lists that are
booked till the next decade. You cannot expect they will
drop everything from their hands and implement the feature
because you need it urgently, or think it is nice. If you are
not willing to implement it yourself, submit patches and maintain
it in the future,
chances are slim. Remarks as "this will attract a lot of
users because..." are considered with a lot of scepticism, since
that applies to any new development.
</TRN>
</OL>
<li><h2><trn key="website.RTL_rel_inf" locale="en_US">Runtime library related information</trn></h2>
<OL>
<!--
<li><a name='HowToUseGraph'></a>
<h3><trn key="website.q_using_graph" locale="en_US">Using the graph unit with Free Pascal</trn></h3>
<trn key="website.a_using_graph" locale="en_US">
<p>Since version 1.0, we have a completely platform independent way
of selecting resolutions and bitdepths. You are strongly encouraged to
use it, because other ways will probably fail on one or other platform.
See the documentation of the graph unit for more information.
</trn>
-->
<li><a name=WrongColors></a>
<h3><trn key="website.q_wrong_colours_using_graph" locale="en_US">Why do I get wrong colours when using the graph unit?</trn></h3>
<trn key="website.a_wrong_colours_using_graph" locale="en_US">
<p>If you use <TT>detect</TT> as graphdriver, you will end up with the