Author Topic: Executable acting strange...  (Read 4085 times)

Punnie

  • Guest
Executable acting strange...
« on: October 21, 2005, 04:49:02 pm »
Hi all,

I don't know if this is possible but somehow my executable when running from the Run command in Code::Blocks is behaving differently from the executable that is created from building my file.

Here's what my program is suppose to do: it reads a bitmap extracts its information and prints the RGB values as characters to a text file. This looks exactly like my bitmap when I run the program from the Run command. However when I run the executable that is created, somehow the image gets swapped some how.

I tried rebuilding after deleting the executable, changing my bitmap file etc but nothing seems to work. Where have I gone stupid?!

Please help!!

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Executable acting strange...
« Reply #1 on: October 21, 2005, 05:06:48 pm »
Does your program accept any command-line parameters? If so, maybe you specified some in Project -> Set programs' arguments that make it behave differently.

Another way to check is to set Settings -> Compiler -> Other -> Compiler logging to "Full command line", then run your project. The log will show exactly what command line Code::Blocks runs (including any command-line parameters) and in which directory (relative to your project dir).
See if pasting that command line into a DOS prompt (with as current working directory the same directory as C::B used) produces the same result as running your program from Code::Blocks.

If you still can't figure it out after checking that, try posting your project (sources, .cbp file and sample input) or a link to it. Maybe that extra information would help people here figure out what's going wrong.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Executable acting strange...
« Reply #2 on: October 21, 2005, 05:08:20 pm »
It could also be that from Code::Blocks, your program is running from ANOTHER directory, and thus it can't find the file you're processing, or creates the text dump somewhere else.

Punnie

  • Guest
Re: Executable acting strange...
« Reply #3 on: October 24, 2005, 09:32:21 am »
Thanks for the hint problem solved now!