Author Topic: Where is output file in codeblocks ?  (Read 18005 times)

Offline vikash

  • Multiple posting newcomer
  • *
  • Posts: 23
Where is output file in codeblocks ?
« on: July 12, 2011, 06:18:33 pm »
I make this code
Code
#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    int a(0);
    cin>>a;
    return 0;
}
it runs when i press F9 but where is this final resultant file. I try at this location project_folder/bin/debug/ in this location their is only one file and it is not running. I have changed code retry but failed. Before today i code in windows 7 but today i code this in xubuntu 11.04.I find .exe file easily their(in windows). So finally tell me where is final resultant file(named as exe in windows).

vikash chandola
« Last Edit: July 12, 2011, 06:20:06 pm by vikash »

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: Where is output file in codeblocks ?
« Reply #1 on: July 12, 2011, 06:27:25 pm »
it's wherever you put it... check your project settings.

if you didn't change it then look for a bin folder in your projects main directory, it's probably in there.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Where is output file in codeblocks ?
« Reply #2 on: July 12, 2011, 06:27:40 pm »
What exactly do you mean with "is not running".
You should know, that executables in linux have (in most cases) no file-endings.
If you double-click a console program it might open and close so fast, that you do not see it.

You should try it from a console:
cd to the folder, where it is located and start it with ./exename

Offline vikash

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: Where is output file in codeblocks ?
« Reply #3 on: July 12, 2011, 07:24:13 pm »
Quote from: ouch
it's wherever you put it... check your project settings.

if you didn't change it then look for a bin folder in your projects main directory, it's probably in there.
Yes it is their but not running either in double click or single click(i have changed setting to single click).
What exactly do you mean with "is not running".
You should know, that executables in linux have (in most cases) no file-endings.
If you double-click a console program it might open and close so fast, that you do not see it.

You should try it from a console:
cd to the folder, where it is located and start it with ./exename
their is a file name like project and have no extensions(in bin folder).
As you can see in code i provide it is required to input something to to end that so it should there for some seconds but it is not there for even a second.

Nothing happens when i double click or single click this file. At least it should appear for very small time but it doesn't appear even for fraction of second.

NOTE: when i debug it asks for input(a) and then close.
« Last Edit: July 12, 2011, 07:28:44 pm by vikash »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Where is output file in codeblocks ?
« Reply #4 on: July 12, 2011, 08:07:10 pm »
Normally linux does not automatically open a console, so:
cd to the folder, where it is located and start it with ./exename

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: Where is output file in codeblocks ?
« Reply #5 on: July 12, 2011, 08:10:53 pm »
I know in ubuntu you can right click on the file and there is a run in terminal option. You might want to check if your linux distribution has something like that.

Offline vikash

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: Where is output file in codeblocks ?
« Reply #6 on: July 12, 2011, 09:11:18 pm »
Normally linux does not automatically open a console, so:
cd to the folder, where it is located and start it with ./exename

what are saying i did not understand.  :?

Offline Freem

  • Almost regular
  • **
  • Posts: 219
Re: Where is output file in codeblocks ?
« Reply #7 on: July 13, 2011, 11:44:58 am »
He just said, open a console, then go to the directory where your executable file should be, then run it.
Code
cd
mean change directory and is the name of the command which allow this.
Code
./exefile
mean that you'll need to tell the system that the file you want to run is the one in the "." directory, so the directory where you are actually.

By example, if your project is directly in your home directory, just type
Code
cd ~/project_folder/bin/debug/
./exefile
. (The ~ is a shortcut to your home directory.)