Lazarus

Free Pascal => FV/Textmode IDE => Topic started by: peter-1 on January 30, 2022, 03:55:33 pm

Title: FPC Compiler
Post by: peter-1 on January 30, 2022, 03:55:33 pm
i despair How can I switch from memory to disc when compiling. the compilation works and there is no error message, but i don't get any save to disc.

Title: Re: FPC Compiler
Post by: marcov on January 30, 2022, 03:58:12 pm
Free Pascal has no compiled to memory option. You must be confused about some other product.
Title: Re: FPC Compiler
Post by: Martin_fr on January 30, 2022, 04:41:55 pm
i despair How can I switch from memory to disc when compiling. the compilation works and there is no error message, but i don't get any save to disc.

Are you using "Lazarus IDE"?

"Lazarus IDE" will save to a temporary directory, if you compile or run.

Normally, this is  C:\Users\YOUR_USER_NAME\AppData\Local\Temp\
And some files in  C:\Users\YOUR_USER_NAME\AppData\Local\Temp\lib

The executable C:\Users\YOUR_USER_NAME\AppData\Local\Temp\project1.exe


You should save your project first. 
You should save to a new, empty folder.
Use menu "Project" > "Save Project as"

After you have saved the project => The executable (project_name.exe) will be in that folder. The folder in which you saved the project.
Title: Re: FPC Compiler
Post by: peter-1 on January 30, 2022, 04:44:33 pm
thanks, but where do I have to enter the target folder?
Title: Re: FPC Compiler
Post by: Martin_fr on January 30, 2022, 04:46:45 pm
When you do "Save project as" you get a normal "save dialog".  (like when you save a text in normal editor or office)

You can select the folder in that dialog.
Title: Re: FPC Compiler
Post by: peter-1 on January 30, 2022, 05:29:12 pm
martin,
yes,
saving via "save as" works fine for the source code but where is the compiled file saved?
Peter
Title: Re: FPC Compiler
Post by: jwdietrich on January 30, 2022, 05:31:38 pm
martin,
yes,
saving via "save as" works fine for the source code but where is the compiled file saved?
Peter

It is saved in this project folder as well.
Title: Re: FPC Compiler
Post by: peter-1 on January 30, 2022, 06:16:14 pm
I'm going crazy. the compiled file is not saved.
Title: Re: FPC Compiler
Post by: MarkMLl on January 30, 2022, 06:18:48 pm
Please report the version etc. of the Lazarus IDE that you're using (Help -> About Lazarus). Also it would be useful if you said what operating system you're using.

MarkMLl
Title: Re: FPC Compiler
Post by: rvk on January 30, 2022, 06:19:11 pm
Please do a
Code: Pascal  [Select][+][-]
  1. Showmessage(paramstr(0));
somewhere in your program. It will show you exactly where your executable is.
Title: Re: FPC Compiler
Post by: peter-1 on January 30, 2022, 06:29:42 pm
this is my version
Title: Re: FPC Compiler
Post by: MarkMLl on January 30, 2022, 06:43:02 pm
That's not Lazarus, so you should be asking in the general forum area not here.

In any event, it /will/ be creating an executable file, and since it appears that you're running some version of Windows it sill have the extension .exe

MarkMLl
Title: Re: FPC Compiler
Post by: Martin_fr on January 30, 2022, 07:00:02 pm
Ok, that is the "Free Pascal IDE" => "FP-IDE"

I do not know the answer "where is the exe".

But I guess: in some folder inside the "project folder". Maybe there is a "lib" or "lib/i368-win" or "lib/x86-64368-win", .... folder?



Or maybe .... Do you have Anti Virus software?

I had problems in the past. AV software would delete my self build exe. And, no it was NOT a virus. 100% sure.
Title: Re: FPC Compiler
Post by: rvk on January 30, 2022, 07:04:57 pm
So do a
Code: Pascal  [Select][+][-]
  1. Writeln(paramstr(0));
and you know where it is.

Title: Re: FPC Compiler
Post by: MarkMLl on January 30, 2022, 07:09:06 pm
So do a
Code: Pascal  [Select][+][-]
  1. Writeln(paramstr(0));
and you know where it is.

Oh, and don't forget to compile and run that.

MarkMLl
Title: Re: FPC Compiler
Post by: peter-1 on January 30, 2022, 07:50:36 pm
the directory is correct and I see it in the string, but it still isn't written to the directory.

Title: Re: FPC Compiler
Post by: MarkMLl on January 30, 2022, 07:57:01 pm
Look, you are /still/ not asking in the right place and I'm not happy being involved since I've not used Windows for years.

Stop the IDE. Start it again and tell us STEP BY STEP EXACTLY what you are doing. Make no assumptions and miss nothing out.

MarkMLl
Title: Re: FPC Compiler
Post by: peter-1 on January 31, 2022, 02:57:12 pm
Thanks for your help. My only problem is that i can't save the .exe or .tpu. everything works without an error message. Saving .pas also works.

Title: Re: FPC Compiler
Post by: MarkMLl on January 31, 2022, 03:03:34 pm
We know what your problems are better than you do and if you don't answer the questions then you don't get any help.

I checked yesterday evening and the fp IDE /does/ save executables. But I'm not taking the time to do a full-blown tech-writing explanation of how to do it: say what you're doing and (subject to OS differences) I and no doubt others will try to duplicate it and find what's happening.

MarkMLl
Title: Re: FPC Compiler
Post by: peter-1 on January 31, 2022, 03:36:09 pm
Excuse me.
I have the PC WIN7 prof. 64bit. freepascal IDE has been reloaded. there are no error messages. unfortunately the compiled file DIA_TPU.TPU cannot be found. that's the only mistake. probably a switch is not set correctly.

Title: Re: FPC Compiler
Post by: rvk on January 31, 2022, 03:40:22 pm
Did you put Writeln(paramstr(0)); in your program?
What did it say after you ran it?

You can set the output directory of the executable in the options so there is no telling for us to where it is.
Only you can give that answer with the value of paramstr(0).
Title: Re: FPC Compiler
Post by: MarkMLl on January 31, 2022, 03:40:41 pm
> DIA_TPU.TPU

Hardly surprising. What makes you think it's generating a file with that name?

MarkMLl
Title: Re: FPC Compiler
Post by: peter-1 on January 31, 2022, 03:47:39 pm
it all worked fine in TurboPascal under WIN98, WINXP or old DOS. I only have to create a UNIT and cannot run the program like this.
Title: Re: FPC Compiler
Post by: peter-1 on January 31, 2022, 03:50:37 pm
the header of the program.
Title: Re: FPC Compiler
Post by: rvk on January 31, 2022, 03:52:08 pm
You will get a .ppu somewhere. A .tpu is for Turbo Pascal. FPC generates .ppu files.

What do you want to do with such a .ppu file?
(It doesn't execute by itself)
Title: Re: FPC Compiler
Post by: PascalDragon on January 31, 2022, 03:54:16 pm
it all worked fine in TurboPascal under WIN98, WINXP or old DOS. I only have to create a UNIT and cannot run the program like this.

Free Pascal does not generate TPUs. Instead the compiled variants of units consist each of a .ppu and a .o, so in your case look for a DIA_TPU.ppu and DIA_TPU.o (both are important if you want to store them somewhere).
Title: Re: FPC Compiler
Post by: peter-1 on January 31, 2022, 05:26:27 pm
OK !
Thank you, thank you, thank you ! :D
That was my stupid mistake. Now it works !
Peter

Title: Re: FPC Compiler
Post by: MarkMLl on January 31, 2022, 06:20:58 pm
[Chuckle] The problem is that we all interpreted what you were saying as that it didn't save a .exe anywhere... which is why I started off from the position of not even assuming that you were running FPC.

MarkMLl
TinyPortal © 2005-2018