简体   繁体   中英

Can't compile project in Visual Studio 2012

I am trying to compile a project and I am getting a weird error

error MSB6003: The specified task executable "CL.exe" could not be run. The process cannot
access the file 'C:\Program Files\Microsoft DKs\Windows\v7.1\Samples\multimedia\directshow\
filters\myparser\UnitTest\Debug\cl.read.1.tlog' because it is being used by another 
process. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets

What might cause this and how can I solve it?

I reproduce this issue when different projects in the same solution were configured with the same "Intermediate Directory".

Suggestions:

  1. disable parallel build. In Tools->Options->Projects and Solutions->Build and Run and set the maximum number of parallel project builds to 1.

  2. be sure the "Intermediate Directory" (Project properties->General) is unique in the solution. ie "$(Configuration)\\$(SolutionName)\\$(ProjectName)\\"

This possibly means you have two builds trying to run at once, or visual studio has locked itself by trying to parallelize the builds. Close all visual studios. Kill all compilers. Try again.

here are some suggestions:

  1. you can download "unlocker" software and use it to determined what other process is using the file

  2. read this: http://social.msdn.microsoft.com/Forums/vstudio/en-US/d54374ff-1d17-4056-8144-eeb13ba7add4/the-specified-task-executable-clexe-could-not-be-run

    according to that post outdated antivirus definition package may cause it. perhaps the antivirus scanned the file and that was the "other process"

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