Euler
Euler

Reputation: 652

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?

Upvotes: 2

Views: 8212

Answers (3)

thooxx
thooxx

Reputation: 51

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. i.e. "$(Configuration)\$(SolutionName)\$(ProjectName)\"

Upvotes: 5

Rayee Roded
Rayee Roded

Reputation: 2640

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"

Upvotes: 1

doctorlove
doctorlove

Reputation: 19232

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.

Upvotes: 2

Related Questions