Windows 7 "access denied" for gcc

This is a discussion on Windows 7 "access denied" for gcc within the Tech Board forums, part of the Community Boards category; I am using Cygwin on my windows 7 machine. I open a 'cmd' with administer privileges and type: gcc -Wall ...

  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    16

    Windows 7 "access denied" for gcc

    I am using Cygwin on my windows 7 machine. I open a 'cmd' with administer privileges and type: gcc -Wall -m32 main.c
    I get "access denied".

    I have checked my environment variables and the 'path' does include C:\cygwin\bin
    Has anyone else had this issue and did you find a solution?

    In addition my 'make' files act weird in Windows 7. When I type the 'make' command, it runs the 'make clean' section.

    any help is appreciated.

    BM

  2. #2
    Registered User carrotcake1029's Avatar
    Join Date
    Apr 2008
    Posts
    398
    I don't have a solution to your cygwin problem, but if your not attached to it, I have never had problems with MinGW+MSYS.

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    412
    The reason you are getting "access denied":
    Code:
    C:\Users\Micke>set PATH=c:\cygwin\bin;%PATH%
    
    C:\Users\Micke>gcc
    Access denied.
    
    C:\Users\Micke>file /usr/bin/gcc.exe
    /usr/bin/gcc.exe: symbolic link to `/etc/alternatives/gcc'
    
    C:\Users\Micke>file /etc/alternatives/gcc
    /etc/alternatives/gcc: symbolic link to `/usr/bin/gcc-4.exe'
    
    C:\Users\Micke>gcc-4
    gcc-4: no input files
    
    C:\Users\Micke>bash
    bash-3.2$ gcc
    gcc: no input files
    Notice that /usr/bin/gcc is a symlink and windows does not support symlinks. (Technically it does; But not in the way cygwin does it)
    Either use a cygwin aware shell like bash or sh, or invoke gcc-3.exe or gcc-4.exe directly.

    Edit:
    Post updated, I was wrong about about why it doesn't work in my original post.
    Last edited by _Mike; 03-25-2010 at 12:25 PM.

  4. #4
    Registered User UltraKing227's Avatar
    Join Date
    Jan 2010
    Location
    USA, New york
    Posts
    123
    should this thread be in the tech-board?

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,849
    Agreed - moved.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows 98/2000 programming in Windows XP
    By Bill83 in forum Windows Programming
    Replies: 3
    Last Post: 07-22-2005, 03:16 PM
  2. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 06:48 PM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 03:55 PM
  4. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 01:19 AM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 06:31 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21