Search code examples
ccygwinmingwsublimetext2sublimetext

sublime text 2 error 5 access is denied


I got this error when I try to build my C program in sublime text 2. I just updated cygwin and MinGW. Also I can't use gcc access from windows command, but g++-3 works.

[Error 5] Access is denied

[cmd:  [u'g++', u'C:\\Users\\Adam\\Desktop\\s', u'-o', u'C:\\Users\\Adam\\Desktop/s']]
[dir:  C:\Users\Adam\Desktop]
[path: C:\csvn\bin\;C:\csvn\Python25\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Java\jre7\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\TortoiseSVN\bin;C:\Users\Adam\AppData\Local\Smartbar\Application\;C:\Program Files (x86)\MySQL\MySQL Utilities 1.3.4\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\SSH Communications Security\SSH Secure Shell;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.7.0_11\bin;C:\cygwin\bin;C:\Program Files\TortoiseSVN\bin;C:\csvn\bin;C:\cygwin64\bin;C:\MinGW\bin]
[Finished]

Solution

  • Try to see if your environment variables are declared for all system and not only for a user. Apparently yes, but I noticed that you don't make explicity reference to the lib of packages of CygWin and MinGW. Try to declare in the environment variable path the absolute path for directory libgcc1, this is the directory that provides mechanical to compile and execute files .c, this is C runtime library, provides support the libraries that you use in you application.

    The possibility also that for some reason in your Windows you don't have privileges of access to directory where you store your source code. Try give permission of execute for this directory, or anything else which the process of compilation and execute may require.