Ok, lets do another approach
Also, I created a new application and added all the packages ant it compiles fine.
Lets try to recover this project. And a few other settings.
1) Check where your primary config is. Menu: View > Ide Internals > About IDE => Search for "primary config path"
If you haven't done a 2ndary install, then likely something like C:\Users\USERNAME\AppData\Local\lazarus
Delete the file "packagefiles.xml" (make a backup)
After that your IDE does no longer know where 3rd party packages are (but it also won't have any wrong paths to them.
Next startup, ignore the warnings. Then open each installed 3rd party/OPM package. Either vie menu Packages, or drop the lpk file.
You can skip this or you can
manually search the file and remove only suspicious entries.
2)
- Close IDE
- Make a backup of the project
- Delete the .lps file of your project. (session file)
Check in the primary config path for an lps file with the project name => delete too (or move / backup)
- Open IDE
- Open the project
- Menu: Project > Project Options
Compiler Options > Path
"Other Unit Files" = empty (or only files inside the project dir, which are not part of any package)
"Include Files" = $(ProjOutDir)
"Libraries" = empty (... as above)
"Unit output directory" = lib\$(TargetCPU)-$(TargetOS) (or similar)
"Target Filename" = empty or project name or whatever the exe should be called (not importand)
.... (you may later re-populate entries that are needed (and inside the project folder)
- Menu: Project > Publish project
Choose a new empty directory
"Filter" = *.(pas|pp|inc|lpr|lfm|lrs|lpi|lpk|xml|sh)
(Simple Syntax)
"Compress" = False
Restart the IDE.
Try building your Project
If you remove any path, and files in those locations are reported "not found" try adding the path back, one by one. Make sure they do not clash with any package.
3)
If not yet fixed
- Close IDE
- Delete the LPI file
- Open IDE
- Drag and drop the LPR file to you IDE
It will ask, if you want to create a new lazarus project => Yes
Then pick the type of app that you had (I assume "Application" for a GUI project with forms)
- You now have to add pack any package that the project used. You will get compile errors for those missing packages.
- You also need to add all the units back to the project (Project inspector > Drop down button "Add" > "Add..." and select from disk)
Alternatively open the .lpi file in an editor and inspect the sections for
<RequiredPackages>
....
</RequiredPackages>
<Units>
....
</Units>