<p>How can I execute <code>a.exe</code> using the Cygwin shell?</p>

<p>I created a C file in Eclipse on Windows and then used Cygwin to navigate to the directory. I called gcc on the C source file and <code>a.exe</code> was produced. I would like to run <code>a.exe</code>.</p>

[{'answer_id': 36003, 'author': 'Allain Lalonde', 'author_id': 2443, 'author_profile': 'https://Stackoverflow.com/users/2443', 'pm_score': 7, 'selected': True, 'text': '<p>./a.exe at the prompt</p>\n'}, {'answer_id': 36004, 'author': 'Kibbee', 'author_id': 1862, 'author_profile': 'https://Stackoverflow.com/users/1862', 'pm_score': 3, 'selected': False, 'text': '<p>you should just be able to call it by typing in the file name.  You may have to call ./a.exe as the current directory is usually not on the path for security reasons.</p>\n'}, {'answer_id': 36005, 'author': 'blank', 'author_id': 1348, 'author_profile': 'https://Stackoverflow.com/users/1348', 'pm_score': 3, 'selected': False, 'text': '<p>just type ./a in the shell</p>\n'}, {'answer_id': 36006, 'author': 'kaiz.net', 'author_id': 3714, 'author_profile': 'https://Stackoverflow.com/users/3714', 'pm_score': -1, 'selected': False, 'text': '<p>Just call it</p>\n\n<pre><code>&gt; a\n</code></pre>\n\n<p>Make sure it will be found (path).</p>\n'}, {'answer_id': 36016, 'author': 'Jason Weathered', 'author_id': 3736, 'author_profile': 'https://Stackoverflow.com/users/3736', 'pm_score': 2, 'selected': False, 'text': '<p>To execute a file in the current directory, the syntax to use is: <code>./foo</code></p>\n\n<p>As mentioned by allain, <code>./a.exe</code> is the correct way to execute a.exe in the working directory using Cygwin.</p>\n\n<p>Note: You may wish to use the <code>-o</code> parameter to <code>cc</code> to specify your own output filename. An example of this would be: <code>cc helloworld.c -o helloworld.exe</code>.</p>\n'}, {'answer_id': 36020, 'author': 'Adam Mitz', 'author_id': 2574, 'author_profile': 'https://Stackoverflow.com/users/2574', 'pm_score': 2, 'selected': False, 'text': '<p>Thomas wrote:</p>\n\n<blockquote>\n  <p>Apparently, gcc doesn\'t behave like the one described in The C Programming language</p>\n</blockquote>\n\n<p>It does in general.  For your program to run on Windows it needs to end in .exe, "the C Programming language" was not written with Windows programmers in mind.  As you\'ve seen, cygwin emulates many, but not all, features of a POSIX environment.</p>\n'}, {'answer_id': 36027, 'author': 'Bernard', 'author_id': 61, 'author_profile': 'https://Stackoverflow.com/users/61', 'pm_score': 1, 'selected': False, 'text': "<blockquote>\n  <p>Apparently, gcc doesn't behave like the one described in The C Programming language, where it says that the command cc helloworld.c produces a file called a.out which can be run by typing a.out on the prompt.</p>\n</blockquote>\n\n<p>A Unix hasn't behaved in that way by default (so you can just write the executable name without ./ at the front) in a long time. It's called a.exe, because else Windows won't execute it, as it gets file types from the extension.</p>\n"}, {'answer_id': 4143872, 'author': 'goldenmean', 'author_id': 2759376, 'author_profile': 'https://Stackoverflow.com/users/2759376', 'pm_score': 2, 'selected': False, 'text': '<p>gcc under cygwin does not generate a Linux executable output file of type " ELF 32-bit LSB executable," but it generates a windows executable of type "PE32 executable for MS Windows" which has a dependency on cygwin1.dll, so it needs to be run under cygwin shell. If u need to run it under dos prompt independently, they cygwin1.dll needs to be in your Windows PATH.</p>\n\n<p>-AD.</p>\n'}, {'answer_id': 28453157, 'author': 'Soukaina', 'author_id': 4357249, 'author_profile': 'https://Stackoverflow.com/users/4357249', 'pm_score': -1, 'selected': False, 'text': '<p>When you start in Cygwin you are in the "/home/Administrator" zone, so put your a.exe file there.</p>\n\n<p>Then at the prompt run:</p>\n\n<blockquote>\n  <p>cd a.exe </p>\n</blockquote>\n\n<p>It will be read in by Cygwin and you will be asked to install it.</p>\n'}]
['https://Stackoverflow.com/questions/35999', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/572/']