Author Topic: Code::Blocks Executable Does Nothing  (Read 3345 times)

Offline Alterah

  • Single posting newcomer
  • *
  • Posts: 5
Code::Blocks Executable Does Nothing
« on: February 12, 2010, 07:00:59 pm »
Hello,

I have searched the forums, but couldn't find a solution to this problem. I have a C++ project that has three files. I've made it a console project in Code::Blocks. It requires a file for input (which may be my problem) However, when I double click the executable (which is a release executable, not a debug one) it pulls up the console very briefly then closes. This isn't a problem of it outputting the results too quickly as my program requires user input. I've also tried running it via the command line, nothing happened. I am new to projects in Code::Blocks, so does my input file for the program need to be in the same folder as my executable? Thanks for your time and help.


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Code::Blocks Executable Does Nothing
« Reply #1 on: February 12, 2010, 07:12:36 pm »
If you right click your project in the manager pane and chose "Properties -> Build targets", you can see (and change) the execution working dir for your targets.
The path is relative to the projects root-dir (if it is not an absolute-path).

Where to put your input file is something nobody here can answer without knowing your program (and asking general programming questions violates our forum rules), but if it should be in the same directory as the executable, put it into the execution working dir.

Offline Alterah

  • Single posting newcomer
  • *
  • Posts: 5
Re: Code::Blocks Executable Does Nothing
« Reply #2 on: February 12, 2010, 07:38:51 pm »
Ok thank you. Currently the input file is where the source files and header files are (which when I run within Code:Blocks it picks up the file just fine). I don't know if that bit of information goes against the rules, if so, don't answer it. Thanks for the other bit of info though.