Recent

Author Topic: Win-10 64-bit, installed Lazarus ver 2.0.10. Laz can't find FPC source dir.  (Read 3978 times)

JohnHerbster

  • Newbie
  • Posts: 4
The instructions said that by far the easiest way to install Lazarus was to DL and run the proper EXE.  I tried that and allowed it to delete my old Lazarus.  Then it needed new FPC update, so I did that (ver 3.2.0) and let it delete the old FPC.  After it finished, I tried running Lazarus and it says that now it needs the FPC sources from $(LazarusDir)fpc\$(FPCVer)\source.  The comment box says
"Directory: C:\Program_Files\Lazarus\1.8\fpc\3.2.0\source\
"Error: directory not found
"You can download FPC and the FPC sources from
"http://sourceforge.net/projects/lazarus/?source=directory.
I cannot find any such folder in that location or anywhere else.
All suggestions will be appreciated.  This morning I had a working, albeit old, IDE.  Now I have none!

Peter H

  • Sr. Member
  • ****
  • Posts: 272
Some months ago I had a similar case.
Remove all traces of fpc Lazarus and fpc related environment variables and reinstall; this should fix it.

wp

  • Hero Member
  • *****
  • Posts: 11830
Whenever I install a new Lazarus version I always do this as a "secondary installation" and use a new directory for the Lazarus user settings. This way the new installation can coexist together with the old one, and I always can switch back if something goes wrong.

I think it is the second page of the installer where you can check the "secondary installation" box. Later you are asked about a folder for the config settings - this should be a new directory without any old config files (I name it c:\laz-configs\laz<version>_fpc<version>). Do not register any files with Windows to open on a double-click, because with multiple installations there is a high chance that the registered version will open the wrong IDE.

To fix your current mess, I agree that it is probably the fastest option when you really delete the old Lazarus folder and its config folder (by default it is in c:\users\<your name>\appdata\local\Lazarus), and reinstall a-new.

JohnHerbster

  • Newbie
  • Posts: 4
Thanks Peter H and WP,
* I uninstalled both FPC and Lazarus and manually cleaned up folders and regedit of leftover stuff.
* Reinstalled FPC first, then Lazarus into C: root.  Tried out Compile on blank form and got 5 warnings and about 515 hints.  * Ran and stopped the *.exe w/o errors. 
* Added “Hello World” and it compiled w/o any more warnings or hints and ran w/o any errors.
I think that perhaps they do not run well when installed in a "Program_Files" folder.
I will think about pursuing  that secondary installation idea next time. 
Thanks again. --JohnH

wp

  • Hero Member
  • *****
  • Posts: 11830
* Reinstalled FPC first, then Lazarus into C: root.
This sounds strange. The standard installer for Windows has its own FPC in the package, so there is no need to install FPC separately.

I think that perhaps they do not run well when installed in a "Program_Files" folder.
Absolutely true. Never install into "c:\Program files". Access to this folder is restricted.

JohnHerbster

  • Newbie
  • Posts: 4
WP, I think that you are right that there is no need to install FPC separately.  I see an FPC folder in my Lazarus folder (C:\lazarus\fpc) and it includes the "source" folder that was missing when I originally posted.
So now do I have two installations of FPC?  And how should I safely remove the extra FPC (C:\FPC)? I'm going to uninstall Lazarus and the FPC and then reinstall Lazarus in the root of the C-drive.
I think that it is a bug in the Lazarus install that allowed me to install it where it would not work properly.
I much appreciate your help.  Rgds, JH

wp

  • Hero Member
  • *****
  • Posts: 11830
Open your Lazarus and look at "Tools" > "Options" > "Files" > "Compiler Executable". Does it list the FPC inside your Lazarus installation? Also look at "FPC Source directory". Does it list either "$(LazarusDir)\fpc\$(FPCVer)\source" or the source folder of the FPC in your Lazarus installation? (The source folder is the one which contains the directories "packages" and "rtl"). If you answer "yes" to both questions then the external FPC in c:\fpc probably is not used. First rename its directory. Restart Lazarus and test if everything works correctly. If yes you can delete the folder. I am quite sure that there is no need to install anything because FPC does not write to the registry.

If "Compiler Executable" and "FPC Source directory" point to the external FPC you can select the FPC which comes with Lazarus here. Type the fpc.exe including its full path into the "Compiler executable" box, and type "$(LazarusDir)\fpc\$(FPCVer)\source" (without quotes) into the "FPC Source Directory" box. Restart Lazarus (maybe not necessary) and just for safety execute "Tools" > "Rescan FPC source directory". Then rename the c:\fpc directory and test working with Lazarus. When you can compile everything you can finally delete c:\fpc like in the former case.

P.S.
I forgot to mention the debugger. I don't know where it is when fpc is installed separately. The one coming with Lazarus is in the folder mingw and the corresponding subfolder of the Lazarus installation. You can check this with "Tools" > "Options" > "Debugger"; the exe is listed in one of the edit boxes here (depends on Laz version). Make sure that it lists the one in the Lazarus folder if you want to delete the c:\fpc folder.

JohnHerbster

  • Newbie
  • Posts: 4
WP, Many thanks.  Your hints are good.  I had already uninstalled Lazarus and the extra FPC and reinstalled Lazarus.  everything and it looks good.  I have just recompiled and run some test programs from a few years ago w/o a hitch.

I have just found https://wiki.freepascal.org/ and I am checking out
https://www.google.com/search?q=convert+delphi+project+to+lazarus
I am sure to have more questions later.

PS: I had started checking out Lazarus in 2017, just before the Hurricane Harvey/Corps of Engineers flood swept through our neighborhood and stopped my programming.  Now, I find that I can't stand to live in retirement w/o being able to do some custom data processing and writing simulation programs.  As an old Delphi expert and Team B member, I really appreciate the work that you volunteers have put into FPC and Lazarus. -JH

PascalDragon

  • Hero Member
  • *****
  • Posts: 5444
  • Compiler Developer
Restart Lazarus and test if everything works correctly. If yes you can delete the folder. I am quite sure that there is no need to install anything because FPC does not write to the registry.

It nevertheless has an installation entry, thus the folder should not be removed, but uninstalled to avoid zombies in Windows' installation database.

 

TinyPortal © 2005-2018