make an executable file in linux

Hey all!

When i compile something on a windows pc with lets say dev-c++ or code::blocks, i always get a simple .exe file which can be opened with a simple double click. On linux (i am using ubuntu) when i compile something with code::blocks i get a file without an extention, but the icon shows that the program is executable. When you double click it, nothing happens. When you give it permissions (allow executing this file as a program) it still doesn't do anything. if you add a command for opening it with Autorun Prompt (which was a wild guess 'cause i thought it would work) it also doesn't do anything, so what the hell? How can i make an executable file in linux that works with a simple double click?
How do you know it's not executed?
Check the running processes and you'll see that it runs (unless the program exits immediately).
it doesn't, it is a simple hello world app, and it has a cin.ignore() at the end.
Why don't you run it from the IDE?

If you open a terminal and run /yourpath/yourexecutablefile it should run
( If you are already in the directory of the executable file run it like this: ./yourexecutablefile
i DO run it from the IDE, but i want to be able to open it using a simple double click, is that possible?
You can change the file association to xterm -e
where do i change it?
Is it a console program? If so, do you expect a terminal to appear? Because that won't happen if you run an executable from a file browser. It will run, but all output will usually be written to the .xsession-errors file.
However, you can create a shell script that runs e.g. gnome-terminal with your program as a parameter. Or just start it from a terminal, which is what you should've done in the first place.
so no way to make it into a single file?
The binary the compiler/linker produces is a single file.
i mean one that works with a simple doubleclick, no shell script or running through the terminal
It "works". If you run it from the file browser, the program will run. If it is a GUI program and creates a window, you'll see the window. If it doesn't, you won't.
If you care about the output or if it expects input, you run it from the terminal.
It's as simple as that.
Topic archived. No new replies allowed.