Program crahes from FBIDE, but not from clicking on it.

General FreeBASIC programming questions.
Post Reply
lassar
Posts: 306
Joined: Jan 17, 2006 1:35

Program crahes from FBIDE, but not from clicking on it.

Post by lassar »

When using FBIDE, I compile and run my windows program it runs, and crashes.

I think what causes it to crash is it cannot find a file or files.

But when I click on the program file in a folder, it runs properly, and does not crash.

I tried reinstalling FBIDE, but no luck.

What is going on here?

Any ideas?
counting_pine
Site Admin
Posts: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: Program crahes from FBIDE, but not from clicking on it.

Post by counting_pine »

Maybe it's a problem with the working directory it runs in from FBIde.
Either way, if you modify your Run command as documented in http://www.freebasic.net/forum/viewtopi ... =2&t=19950, you'll be able to see whatever message comes up when the program quits.
lassar
Posts: 306
Joined: Jan 17, 2006 1:35

Re: Program crahes from FBIDE, but not from clicking on it.

Post by lassar »

Don't know why that helps, but it doesn't seem to be crashing from the fbide now.

Go figure.
fxm
Moderator
Posts: 12131
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Program crahes from FBIDE, but not from clicking on it.

Post by fxm »

lassar wrote:Don't know why that helps, ...
I think that counting_pine is referring to these two points of FBIde settings:
counting_pine wrote:- Compiling with -exx
This enables the largest possible amount of error checking, aborting the program on things like problems opening files, or going out of bounds on an array.

Compiler command:
"<$fbc>" "<$file>" -exx
counting_pine wrote:- Leaving the command line window open when the program finishes
This basically consists of wrapping the Run command in "cmd /c [Run command] & pause", which opens up a command window which does the Run Command, and then run Pause to wait for a keypress before closing. This is a good alternative to putting Sleep at the end of a console program, and also stops the window closing if the program aborts with an error, allowing you to see the message returned. So it's good to use with '-exx' (not so useful with '-s gui').

Run command:
cmd /c "<$file>" <$param> & pause
This will work on any version of Windows that uses cmd, e.g. Windows 2000/XP. I haven't tested on Vista/7, but there is a report of it working on 7, so both are probably fine.
Post Reply