Recent

Author Topic: After saving my program to a newname I cannot compile it anymore  (Read 1243 times)

HansDouwe

  • New member
  • *
  • Posts: 9
After saving my program to a newname I cannot compile it anymore
« on: November 26, 2020, 02:22:07 pm »
Hello
I have a long experience with programming pascalprograms, but I;m new on Lazarus.
I had made an old Pascal programs that I like to change and execute with Lazarus.
After starting Lazarus I choose for a new program and copied my old progam in Project1.
After that I'm able to change, compile, debug and run my program succesfully.
But after I saved my program to a new name (NEWNAME), its not possible anymore to compile my program.
I get the message: "cannot find strutils used by NEWNAME. Make sure all ppu files of a package are in its output directory. ppu in wrong directory=D:\FPC\3.2.0\units\i386-win32\rtl-objpas\strutils.ppu".
Please can you tell me what I'm doing wrong and how I had to solve this problem?



jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: After saving my program to a newname I cannot compile it anymore
« Reply #1 on: November 26, 2020, 02:54:33 pm »
What version of Lazarus ?

Also, did you check to ensure the file it is complaining about is actually located in its folder where it is looking for it ?

It could be a mistake was made and something got deleted.
The only true wisdom is knowing you know nothing

HansDouwe

  • New member
  • *
  • Posts: 9
Re: After saving my program to a newname I cannot compile it anymore
« Reply #2 on: November 26, 2020, 03:30:51 pm »
I use Lazarus IDE V2.0.10 r63526.
I've uninstalled and installed Lazurus several times last days, because I'll tried to solve thos problem by myself.
Also I've free pascall installed separately on my computer, because I'm used to use free pascal stand alone.

When I copied my program in a new program at Lazarus again its working succesfully again until I saved the program again.
Even if I saved the program to project1. From then the error about the strutils and the ppu came back again.

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: After saving my program to a newname I cannot compile it anymore
« Reply #3 on: November 26, 2020, 03:36:20 pm »
go into the Tools:Options:Files and set the Lazarus\Fpc\ path to point to the one that comes with Lazarus.
The only true wisdom is knowing you know nothing

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: After saving my program to a newname I cannot compile it anymore
« Reply #4 on: November 26, 2020, 04:01:09 pm »
No no, don't change any paths unless you know exactly what you are doing.

What kind of program is it? I assume it is a console program consisting of a single unit. In this case, copy this pas file to a new folder (just to keep the original), open it in Lazarus - you will be prompted for a project template, select "Simple program". Select "File" > "Save as" to save to the new name that you want. Compile and and run -- it must work. If it does not something is wrong in your installation. In this case uninstall the old installation, delete the config folder (in Windows in c:\Users\<your name >\appdata\local\Lazarus, in Linux in ~/.lazarus) and reinstall again.

BTW, what is your OS?

HansDouwe

  • New member
  • *
  • Posts: 9
Re: After saving my program to a newname I cannot compile it anymore
« Reply #5 on: November 26, 2020, 06:50:53 pm »
Thank you Jamie and wp for the suggestions, but I'm still doing someting wrong.

I'm using Windows 10.

I've unistalled FPC and Lazarus
I've removed the FPC and Lazarus directory
I've removed the whole config folders in ....\appdata\Local\lazarus and ...\appdata\local\fpc

I only reinstalled Lazarus.

I select for a new simple program and put a program in the working-area. And save it to a new name. I tried to compile it, but it doesn't work.

Before saving the program is working perfect:
I selected for a new simple program again, but now I didn't save the program.
Now it possible to compile, edit, debug and run the program succesfully. !!!
Unfortunally after saving the program again the compiling error came back again:

The exact message now is:  "cannot find strutils used by NEWNAME. Make sure all ppu files of a package are in its output directory. ppu in wrong directory=D:\Lazarus\FPC\3.2.0\units\i386-win32\rtl-objpas\strutils.ppu".
I've checked again D:\Lazarus\FPC\3.2.0\units\i386-win32\rtl-objpas\strutils.ppu exists.

By the way may be this is  importent:
When I the stand alone FPC uninstalled the uninstall aplication was warning me that it couldn't uninstall the units, because these were missing in D:\FPC.
After the uninstall of FPC Lazurus messaged it was missing the whole FPC-compiler..
So it looks like the installation of FPC and Lazarus was not independent.

I don't know what to do now. I hope you can help me.


wp

  • Hero Member
  • *****
  • Posts: 11915
Re: After saving my program to a newname I cannot compile it anymore
« Reply #6 on: November 26, 2020, 07:15:45 pm »
Another idea: Into which directory did you install? Do not install into "c:\program files" because you may not have write permissions there and some of the Lazarus tools do not like the space in the directory name. Install into c:\Lazarus, or maybe c:\Lazarus_2.0.10

And: Which virus scanner are you using? I know that same of them are very aggressive toward the Lazarus/FPC tool chain. I had to get rid of BitDefender and returned to Windows Defender. At least put your Lazarus folder and your project folder on the white list of the scanner.

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: After saving my program to a newname I cannot compile it anymore
« Reply #7 on: November 26, 2020, 07:19:11 pm »
ok, how are you renaming the program ?

are you using the PROJECT:SAVEAS ?

also there is an option for the output name and folder.
The only true wisdom is knowing you know nothing

HansDouwe

  • New member
  • *
  • Posts: 9
Re: After saving my program to a newname I cannot compile it anymore
« Reply #8 on: November 26, 2020, 07:35:17 pm »

I installed Lazarus on D: \ Lazarus.
I save via File Save or File save as. After both actions I cannot compile anymore.
I don't have a special virus scanner.

HansDouwe

  • New member
  • *
  • Posts: 9
Re: After saving my program to a newname I cannot compile it anymore
« Reply #9 on: November 26, 2020, 07:37:32 pm »
I installed Lazarus in D:\Lazarus (without spaces)

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: After saving my program to a newname I cannot compile it anymore
« Reply #10 on: November 26, 2020, 07:42:39 pm »
Please post the program that you cannot compile any more after saving. Pack the .lpi, lpr, .lfm, and .pas files to a common zip and upload it via "Attachments and other options".

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: After saving my program to a newname I cannot compile it anymore
« Reply #11 on: November 26, 2020, 07:43:05 pm »
Well I don't know about your spaces but you are suppose to use the PROJECT:SaveAs so it saves it all

you can then specify a different binary name for the EXE on top of that..

the FILE:saveas only changes the editing files/
The only true wisdom is knowing you know nothing

HansDouwe

  • New member
  • *
  • Posts: 9
SOLVED: After saving my program to a newname I cannot compile it anymore
« Reply #12 on: November 28, 2020, 09:18:45 am »

329/5000
Yesterday after restarting my computer the problems were solved once.
I had both Free Pascal and Lazarus seperated installed and running at the same time. FPC a long time ago. Lazarus just a few days ago. I suspect these programs have interfered with each other in a wrong way. After uninstalling FPC, when I tried to compile, Lazarus reported unexpected that it had lost the entire compiler.
Now - after reinstalling Lazarus only and restart of my computer - everything is running smoothly.

Thank you for the help provided.

 

TinyPortal © 2005-2018