I’m using Ubuntu 8.10 (Intrepid Ibex) and compiling C++ files with GCC, but when I compile, gcc makes an a.out file that is the executable. How can I make Linux executables?
I’m using Ubuntu 8.10 (Intrepid Ibex) and compiling C++ files with GCC, but when
Share
That executable is a "Linux executable" – that is, it’s executable on any recent Linux system. You can rename the file to what you want using
or better yet, tell GCC where to put its output file using
Keep in mind that before Linux systems will let you run the file, you may need to set its "executable bit":
Also remember that on Linux, the extension of the file has very little to do with what it actually is – your executable can be named
something,something.out, or evensomething.exe, and as long as it’s produced by GCC and you dochmod +xon the file, you can run it as a Linux executable.