Recent

Author Topic: FP crashes after running run  (Read 3381 times)

anon

  • New member
  • *
  • Posts: 7
FP crashes after running run
« on: January 12, 2025, 08:12:46 pm »
Hello, what should I do when free pascal crashes after using run option? When I use compile option and then start the exe file manually using windows cmd prompt, it works. But why it crashes when I use CTRL + F9?
I have windows 10 64x PC.

https://streamable.com/xkyj6q Here is video for you to understand my issue
« Last Edit: January 13, 2025, 08:48:55 pm by anon »

jamie

  • Hero Member
  • *****
  • Posts: 6801
Re: FPC crashes after running run
« Reply #1 on: January 12, 2025, 08:16:56 pm »
I am not watching the video, but you most likely have a debugger issue.

Try running it from the IDE without Debugging.
The only true wisdom is knowing you know nothing

anon

  • New member
  • *
  • Posts: 7
Re: FPC crashes after running run
« Reply #2 on: January 12, 2025, 08:20:14 pm »
How? I start program using CTRL F9 and it crashes

Thaddy

  • Hero Member
  • *****
  • Posts: 16520
  • Kallstadt seems a good place to evict Trump to.
Re: FPC crashes after running run
« Reply #3 on: January 12, 2025, 08:23:48 pm »
Hello, what should I do when free pascal crashes after using run option?
Fix your code?  >:D
But I am sure they don't want the Trumps back...

jamie

  • Hero Member
  • *****
  • Posts: 6801
Re: FPC crashes after running run
« Reply #4 on: January 12, 2025, 08:36:04 pm »
How? I start program using CTRL F9 and it crashes

try
 Shift+CTRL+F9
The only true wisdom is knowing you know nothing

anon

  • New member
  • *
  • Posts: 7
Re: FPC crashes after running run
« Reply #5 on: January 12, 2025, 08:37:03 pm »
Its not issue with code, even hello world program like this crashes it when running run

program Hello;
begin
  writeln ('Hello, world.');
  readln;
end.

jamie

  • Hero Member
  • *****
  • Posts: 6801
Re: FPC crashes after running run
« Reply #6 on: January 12, 2025, 08:42:48 pm »
are you using the FPC IDE?

use the Lazarus IDE and select a simple program for your project, that will generate a console app.

if you are selecting and Application then yes, those procedures will crash at runtime but will work if you start it from the CMD because a console is already operating.


The only true wisdom is knowing you know nothing

anon

  • New member
  • *
  • Posts: 7
Re: FPC crashes after running run
« Reply #7 on: January 12, 2025, 09:11:20 pm »
Yes, I use FPC IDE. I tried using CTRL+SHIFT+F9, but it still crashes.

How can I fix it?

Thaddy

  • Hero Member
  • *****
  • Posts: 16520
  • Kallstadt seems a good place to evict Trump to.
Re: FPC crashes after running run
« Reply #8 on: January 12, 2025, 09:11:50 pm »
Its not issue with code, even hello world program like this crashes it when running run

program Hello;
begin
  writeln ('Hello, world.');
  readln;
end.
Then you need to re-install. (If the above is true, you have an installation mishap)
But I am sure they don't want the Trumps back...

TRon

  • Hero Member
  • *****
  • Posts: 3946
Re: FPC crashes after running run
« Reply #9 on: January 12, 2025, 09:12:00 pm »
Hello, what should I do when free pascal crashes after using run option?
First of all, please do not use video's. They are a time-waster.
Secondly, I do not see any crash. Only FPC-IDE that fails to execute your executable.
And last, rename your program. FPC expects a valid identifier (which it currently isn't).
I do not have to remember anything anymore thanks to total-recall.

jamie

  • Hero Member
  • *****
  • Posts: 6801
Re: FPC crashes after running run
« Reply #10 on: January 12, 2025, 09:20:00 pm »
I've only used the FPC just to see what it is but it seems that somehow you could be generating the wrong app.

Try putting this at the top of the source after the "program proper_name"
{$AppType Console}

The only true wisdom is knowing you know nothing

anon

  • New member
  • *
  • Posts: 7
Re: FPC crashes after running run
« Reply #11 on: January 13, 2025, 07:48:39 pm »
https://prnt.sc/PhExYVUm98pc
Also when I put that and press run, the IDE closes, I dont see any output from the program and it doesn't return back to ide, it closes and I have to start it again.

My program works, when I use compile option in FPC and then open windows cmd prompt and go to C:\FPC\3.2.2\bin\i386-win32 directory and then run the executable file compiled by FPC, it works. https://prnt.sc/ga-eC6QortM4

The issue is with FPC ide, it does for every program the same and it's annoying that I have to run the executables manually and can't use run option.
To reproduce:
- Make program in FPC - https://prnt.sc/I97MEMs7dwFy
- Use run option or press CTRL + F9 or CTRL + SHIFT + F9
- FPC IDE will exit and you will have to open it again, no output is there

This is my version of FPC https://prnt.sc/P0n81s5DAZRU


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10799
  • Debugger - SynEdit - and more
    • wiki
Re: FPC crashes after running run
« Reply #12 on: January 13, 2025, 08:14:39 pm »
What crashes is not "FPC" but the "FP IDE". At least most likely. Fpc is the compiler itself. You might want to edit your initial message and change the Subject accordingly.


You could try to install fpc 3.2.2 or 3.3.1 both have bugfixes that were made since 3.2.2. But they are both "working versions", they are not releases, they do not have downloads, they need to be build from source.


You could also try to see what causes the crash.
Run cmd.exe and then inside cmd.exe start the fp.exe => then when it crashes, the window should remain open, and maybe something of interest got printed on the screen.
If not, then you need to make a debug build, and debug it....

jamie

  • Hero Member
  • *****
  • Posts: 6801
Re: FPC crashes after running run
« Reply #13 on: January 13, 2025, 08:37:47 pm »
Maybe run the fpc ide from the cmd.
The only true wisdom is knowing you know nothing

anon

  • New member
  • *
  • Posts: 7
Re: FPC crashes after running run
« Reply #14 on: January 13, 2025, 08:48:43 pm »

 

TinyPortal © 2005-2018