none
LNK1104 Access Denied Error

    Question

  • I am trying compile a very basic C++ program, found 

    https://dl.dropboxusercontent.com/u/13955176/lab10Redeux.zip

    . However, every time I compile I get these two errors: 

    Access to path "Path/To/Exe/File" is denied.  File: Microsoft.Cpp.Clean.targets Line: 76

    LNK1104 Cannot open file "Path/To/Exe/File" File: LINK Line: 1

    This happens every time I complie, whether it be in safe mode, VS safe mode, right after a reboot or whatever. 

    I am running Windows 10, so the enabling the "Application Experience" service does not work, because I think that service is not a part of Windows 10.

    The process appears in the Task Manager, but it cannot be killed, for "access is denied." Using process manager or trying to delete the file shows that it is "System" locking it up, and neither operation can be completed successfully. I have tried disabling code optimization, multi-core compiling and putting the /FS tag on the compiler, all to no avail. What must I do?


    Wednesday, December 2, 2015 3:41 PM

Answers

  • Hi TheMcBrideCode,

    >>LNK1104 Cannot open file "Path/To/Exe/File".

    This document shared us the possible reasons which will generate this error message, if possible, you could refer to it here:

    https://msdn.microsoft.com/en-us/library/ts7eyw4s.aspx?f=255&MSPPError=-2147217396

    To make sure that it is not your VS setup issue, could you create a simple VC++ APP? and then run it in your side. If a simple VC++ app still has this issue, we could think about the VS/Windows Environment.

    As Brian Muth's reply, it worked well in his VS2015, at least, we could know that it is not the project's issue(sorry for that I could visit the sample shared by you now).

    The VS2015 community would support the VC++ app, so if possible, you could check that whether it is related to the VS setup. Please repair your VS2015, and then install the update 1. Restart your machine, test it again.

    Please also close the "security" software/third party processes in your window like the anti-virus software or others, and then test it again. I met some members met the debugging issue in they machine when they installed certain "security" software, that's the reason why I suggest you close them in your windows.

    If you get any latest information, please feel free to let me know.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 4, 2015 6:49 AM
    Moderator

All replies

  • I'm using Visual Studio 2015, and it compiles and links successfully for me.

    What version are you using?

    Wednesday, December 2, 2015 4:15 PM
  • Well, I am glad that it isn't just my code that is causing it. I am using Visual Studio Community 2015. I will try doing a repair of VS to see what happens. I have permissions to edit the file and I have also tried running VS as an admin.

    EDIT: New info: after a reboot, I tried to just compile it, which went fine. When I tried to attach the debugger, it hung indefinitely, which makes me thing that i might be a problem with the debugger.

    Wednesday, December 2, 2015 4:56 PM
  • When I tried to attach the debugger, it hung indefinitely, which makes me thing that i might be a problem with the debugger.

    I'm not sure what you mean by "attach a debugger", since you should simply run it in debug mode from within Visual Studio. Place a breakpoint on the very first executable line and single-step through the program and see what happens. I'm very dubious you have a problem with the debugger.
    Wednesday, December 2, 2015 7:51 PM
  • What I meant by that is that I can build, clean or compile the program, but when I try and Build+run, it hangs.

    Further testing reveals that I cannot open the compiled program to run, build+run, or build+run without the debugger (e.g. manually opening the file, F5 and Ctrl+F5 all do not work.)

    Wednesday, December 2, 2015 8:21 PM
  • Hi TheMcBrideCode,

    >>LNK1104 Cannot open file "Path/To/Exe/File".

    This document shared us the possible reasons which will generate this error message, if possible, you could refer to it here:

    https://msdn.microsoft.com/en-us/library/ts7eyw4s.aspx?f=255&MSPPError=-2147217396

    To make sure that it is not your VS setup issue, could you create a simple VC++ APP? and then run it in your side. If a simple VC++ app still has this issue, we could think about the VS/Windows Environment.

    As Brian Muth's reply, it worked well in his VS2015, at least, we could know that it is not the project's issue(sorry for that I could visit the sample shared by you now).

    The VS2015 community would support the VC++ app, so if possible, you could check that whether it is related to the VS setup. Please repair your VS2015, and then install the update 1. Restart your machine, test it again.

    Please also close the "security" software/third party processes in your window like the anti-virus software or others, and then test it again. I met some members met the debugging issue in they machine when they installed certain "security" software, that's the reason why I suggest you close them in your windows.

    If you get any latest information, please feel free to let me know.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 4, 2015 6:49 AM
    Moderator