A r t i c l e s
Navigation

Note: This site is
a bit older, personal views
may have changed.

M a i n P a g e

D i r e c t o r y

FreePascal Compiler Troubleshooting


Compiler says:
 Warning: Comment level 2 found
 Fatal: Unexpected end of file
Check for open comments, i.e. an open parenthisis {} , an open (* *). Also if you are using an older compiler without certain command line options set, you may have a nested comment problem
DLL or Library issues:
 
 Remember in some cases, in your DLL/program you can define:
  {$apptype GUI} // you may need to define this for a DLL in Windows, if the DLL is   
                 // being called from a GUI program. 

Problem: "Cannot find unit types"
         "Can't find unit types"
         "Can't find unit system"
Solution:
 It could be:
  -Damaged FPC.CFG file
  -Did you delete FPC.CFG file by accident?
  -Try a fresh copy of FPC.CFG that came with your installation. 
   Rename the old one to fpc.cfg.old
  -on linux, you could have a conflict. try deleting /usr/lib/fpc 
    then apt-get --purge fp-compiler.
    then apt-get install fp-units-rtl
    then apt-get install fp-compiler

Problem:
 Error: Can't call the linker, switching to external linking

Many causes for this one (use the -va compiler option to see more details).. but..
Possible causes: 
 - not enough memory available (especially on big programs).
 - FPC 2.0.X and source code still uses short strings, try shorter paths everywhere!  
   store your program and units in a nice short path C:\tmp\ or /home/tmp/ on linux.
 - problems with linker. Remove bin utils and reinstall them, check environment PATH  
   variables. 

Problem:
 cannot find -lpthread

Solution:
 apt-get install libc6-dev



About
This site is about programming and other things.
_ _ _