简体   繁体   中英

“Unable to create directory” error with “Access to path is denied.” when building a solution in Visual Studio

I'm trying to build a VS2010 C++ project in VS2013 (to be precise, an example project from Steinberg Vst SDK) and get the following error:

C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\V120\\Microsoft.CppBuild.targets(1235,5): error MSB3191: Unable to create directory "C:\\Program Files (x86)\\Common Files\\VST3\\Steinberg". Access to the path 'C:\\Program Files (x86)\\Common Files\\VST3\\Steinberg' is denied.

I haven't modified anything. I've tried to find an answer but the ones i found either are very vague, or doesn't apply to C++. From the error it's clear the problem is that i can't output to Program Files since it's read-only , so how do i change the output directory?

EDIT: I've modified the "Output directory" field in project's properties -> configuration properties -> general tab. However, the error stays the same.

EDIT2: SOLVED the problem. The linker output was set to Program Files.

Thanks in advance for answers.

I would not change it. The problem is not that Program Files is read only, the problem is that you cannot write to it with user level permissions.

The best way to solve this is to change your output to a different location, like under your C:\\Users\\<yourname> where you will have permissions.

If you really want to to do it in Program Files anyway, you can run Visual Studio as an administrator. But I still recommend changing your output folder over doing that.

Even if this post is rather old: The linker tab in the project properties holds an output file variable which by default is something like "$(CommonProgramFiles)\\VST3\\Steinberg\\$(ProjectName)$(TargetExt)". Change that to a path you / VS has writing rights to and things should work again.

Regards, G.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM