News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Where is output file in codeblocks ?

Started by vikash, July 12, 2011, 06:18:33 PM

Previous topic - Next topic

vikash

I make this 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

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.

Jenna

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

vikash

#3
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).
Quote from: jens 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
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.

Jenna

Normally linux does not automatically open a console, so:
Quote from: jens on July 12, 2011, 06:27:40 PM
cd to the folder, where it is located and start it with ./exename

ouch

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.

vikash

Quote from: jens on July 12, 2011, 08:07:10 PM
Normally linux does not automatically open a console, so:
Quote from: jens on July 12, 2011, 06:27:40 PM
cd to the folder, where it is located and start it with ./exename

what are saying i did not understand.  :?

Freem

He just said, open a console, then go to the directory where your executable file should be, then run it.
cd mean change directory and is the name of the command which allow this.
./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

cd ~/project_folder/bin/debug/
./exefile
. (The ~ is a shortcut to your home directory.)