Thanks for all the help everyone, though unfortunately I still haven't figured it out. Perhaps I didn't set up the PATH correctly?

Here, I cleared the projects folder except for helloworld, and try to run it:


Saad Khalid@SaadKhalid-PC ~
$ cd c:\projects

Saad Khalid@SaadKhalid-PC /c/projects
$ ls
helloworld.c

Saad Khalid@SaadKhalid-PC /c/projects
$ gcc helloworld.c -o helloworld.exe
sh: gcc: command not found


>what does od -bc helloworld.c show for your source file?

Saad Khalid@SaadKhalid-PC /c/projects
$ od -bc helloworld.c
0000000 043 151 156 143 154 165 144 145 040 074 163 164 144 151 157 056
          #   i   n   c   l   u   d   e       <   s   t   d   i   o   .
0000020 150 076 015 012 151 156 164 040 155 141 151 156 050 051 040 173
          h   >  \r  \n   i   n   t       m   a   i   n   (   )       {
0000040 015 012 040 040 160 162 151 156 164 146 050 040 042 150 145 154
         \r  \n           p   r   i   n   t   f   (       "   h   e   l
0000060 154 157 040 167 157 162 154 144 134 156 042 040 051 073 015 012
          l   o       w   o   r   l   d   \   n   "       )   ;  \r  \n
0000100 040 040 162 145 164 165 162 156 040 060 073 015 012 175
                  r   e   t   u   r   n       0   ;  \r  \n   }
0000116


> If that still fails, please show the output of "which gcc"

Saad Khalid@SaadKhalid-PC /c/projects
$ which gcc
which: gcc: unknown command




On Fri, Mar 21, 2014 at 9:40 AM, Keith Marshall <keithmarshall@users.sourceforge.net> wrote:
On 21/03/14 13:08, JonY wrote:
> As for "." sneaking in, I think it is inherited from the cmd
> environment, but I haven't been using MSYS recently to verify this.

It doesn't "sneak" in; it is explicitly added by /etc/profile, where
Earnie's comment explains that it is to emulate cmd.exe or command.com
behaviour.  There's nothing unreasonable in that, but it was always my
personal preference, when I used MSYS regularly -- I no longer do so,
since I no longer use MS-Windows for anything but final testing of
cross-compiled MinGW code -- to remove it.

--
Regards,
Keith.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
MinGW-users mailing list
MinGW-users@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@lists.sourceforge.net?subject=unsubscribe



--
--------------------------------------------
(\__/) This is Bunny. Copy Bunny into
(O.o ) your signature to help him
(> < ) on his way to world domination
--------------------------------------------