When I'm trying to build my VC++ code using 2010 I'm getting the error message
> C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
Please tell how to overcome this?
Navigate from Error List Tab to the Visual Studios Output folder by one of the following:
Select tab Output in standard VS view at the bottom
Click in Menubar View > Output or Ctrl+Alt+O
where Show output from <build> should be selected.
You can find out more by analyzing the output logs.
In my case it was an error in the Cmake step, see below. It could be in any build step, as described in the other answers.
> -- Build Type is debug
> CMake Error in CMakeLists.txt:
> A logical block opening on the line
> <path_to_file:line_number>
> is not closed.
error MSB6006: "cmd.exe" exited with code -Solved
I also face this problem . In my case it is due to output exe already running .I solved my problem simply close the application instance before building.
I had the same problem today, while I was upgrading some VC6 project to VC2012.
In my case, it was because some of the operation in Custom Built Steps failed.
In project properties, go to Custom Build Step, you can see there maybe some something in command line edit box. Open a windows prompt and paste the command to it. Run, check if there is something wrong and fix it.
If there is no command line in the project property Custom Built Step, maybe you should check properties of every single file of the project.
If the command line has some macro, replace it with an actual value.
Or you can echo the command in VS output window:
cd %(somedir)%
echo %(somedir)%
You won't miss it this way.
I solved this. double click this error leads to behavior.
open .vcxproj file of your project
search for tag
check carefully what's going inside this tag, the path is right? difference between debug and release, and fix it
clean and rebuild
for my case. a miss match of debug and release mod kills my afternoon.
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy ..\vc2005\%(Filename)%(Extension) ..\..\cvd\
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">copy ..\vc2005\%(Filename)%(Extension) ..\..\cvd\
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\cvd\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\cvd\%(Filename)%(Extension);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy ..\vc2005\%(Filename)%(Extension) ..\..\cvd\
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">copy %(Filename)%(Extension) ..\..\cvd\
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\cvd\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\cvd\%(Filename)%(Extension);%(Outputs)</Outputs>
</CustomBuild>
Actually Just delete the build ( clean it ) , then restart the compiler , build it again problem solved .
I also faced similar issue.
My source path had one directory with 'space' (D:/source 2012). I resolved this by removing the space (D:/source2012).
For the sake of future readers. My problem was that I was specifying an incompatible openssl library to build my program through CMAKE. Projects were generated but build started failing with this error without any other useful information or error. Verbose cmake/compilation logs didn't help either.
My take away lesson is that cross check the incompatibilities in case your program has dependencies on the any other third party library.
Simple and better solution :
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MyProject.sln
I make a bat file like this
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe D:\GESTION-SOMECOPA\GestionCommercial\GestionCommercial.sln
pause
Then I can see all errors and correct them. Because when you change the folder name (without spaces as seen above) you will have another problems. Visual Studio 2015 works fine after this.
When working with a version control system where all files are read only until checked out (like Perforce), the problem may be that you accidentally submitted into this version control system one of the VS files (like filters, for example) and the file thus cannot be overridden during build.
Just go to your working directory and check that none of VS solution related files and none of temporary created files (like all moc_ and ui_ prefixed files in QT, for example) is read only.
I was in a similar situation to the one described by "irsis".
I configured the project through CMAKE, and in CmakeList, I linked the OpenCV library to the project. However, when I updated the OpenCV version for another project, the path was changed and error occurred.
Check path of all related library.
Another solution could be, that you deleted a file from your Project by just removing it in your file system, instead of removing it within your project.
Related
I can't build my application anymore,
every time I try to compile the following error arises.
error MSB6006: "lc.exe" exited with code -1
I've never changed anything within the Microsoft.Common.CurrentVersion.targets file (or any other file which is related to MSBuild).
Full path to the file:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets
Rows where the error seems to be/arise:
<LC
Sources="#(_LicxFile)"
LicenseTarget="$(TargetFileName)"
OutputDirectory="$(IntermediateOutputPath)"
OutputLicense="$(IntermediateOutputPath)$(TargetFileName).licenses"
ReferencedAssemblies="#(ReferencePathWithRefAssemblies);#(ReferenceDependencyPaths)"
NoLogo="$(NoLogo)"
ToolPath="$(LCToolPath)"
SdkToolsPath="$(TargetFrameworkSDKToolsDirectory)"
EnvironmentVariables="$(LCEnvironment)"
MSBuildArchitecture="$(LCMSBuildArchitecture)"
TargetFrameworkVersion="$(TargetFrameworkVersion)"
>
The main problem here is that I can compile every other application, but not my most important one which is written in C# WPF with the .NET Framework 4.7.2.
Does anyone have a clue why I might can't compile the solution?
error MSB6006: “lc.exe” exited with code -1
This error means that your project has something wrong rather than Microsoft.Common.CurrentVersion.targets file
In fact, to see the specific error, you should set your Build Output log to Diagnostic/Detailed by Tools-->Options-->Projects and Solutions-->Build and Run-->set MSBuild project build output verbosity to Diagnostic/Detailed. Then when you build again, you can see the detailed info about it.
And you can try to follow these syggestions:
Please check whether you have any warnings on your nuget packages. If so, please reinstall them or just use update-Package -reinstall under Package Manage Console.
If you have any post(pre)-build event(Right-click on your project-->Properties-->Build Event), please check whether the command has some errors.
If you have licenses.licx files, you should exclude them from your project.
you can try to create a new WPF project and then add the same as the previous project to test if it is the issue of your project.
do a repair in VS Installer in case there are something with your VS Environment or update your VS to the latest version.
In addition, if possible, please share the xxxxx.csproj file of your WPF project with us to troubleshoot your issue quickly. Also, there is a similar issue about this error.
So I've look at a few questions here which popped up after a search, but I still haven't managed to get this to work.
My project has two files, main.cpp and shader.comp.
The shader needs to be compiled before the main program is ran and I have a small .bat script that does just that. It's set to run as a pre-build event.
However, if I edit shader.comp and leave main.cpp unmodified since I last ran the project, there is no need to rebuild the project (according to VS anyway), so there is no need to run any pre-build events and my shader doesn't get compiled.
Is there a way to tell VS2017 (or VS2019) that if some file is modified, then run something, or at least a way to add an arbitrary file to list of files that VS checks against when deciding whether to run the build or not?
I've tried setting "Exclude from build" to "No" in the file properties, but no matter what "Item type" I choose, editing just the shader won't trigger the rebuild.
It's possible to define the shader that needs to be compiled as Custom Build Tool in the properties of the file (as Item Type). This will open another menu in the properties where cmd script and similar can be written.
In this particular case, value for Command Line was:
glslangValidator.exe -V -o "%(RootDir)%(Directory)%(Filename).spv" "%(FullPath)"
And the Outputs:
%(RootDir)%(Directory)%(Filename).spv
In short, if file defined in Outputs doesn't exists or is older than the owner of this property (the file that needs to be compiled), the Command Line argument will be ran in cmd.
Official documentation has more info on this.
Maybe you can get some help from this issue. You can specify the files for VS Up-To-Date check.
<Project...>
...
<ItemGroup>
<UpToDateCheckInput Include="shader.comp" /> <!--when this file is in the project folder-->
<!--<UpToDateCheckInput Include="path/shader.comp" />-->
</ItemGroup>
</Project>
And this script into your project file. Then if there's any change to shader.comp file,VS will build your project.
Note: In this way, if you only change the shader.comp file , but not change the source file(xx,cpp), the build will start but vs will skip the compile target of C++ source code. Only when you modify the source code main.cpp, then VS will run the pre-build event and compile the code. Let me know if it's what you want, hope i didn't misunderstand anything :)
I recently tried to use the vs-tool found here done by James Allison. This works well for the *.html and *.js builds, but it fails for the *.bc builds. The error message presented is "GCCLIB : error root: rcs: No such file or directory ("rcs" was expected to be an input file, based on the commandline arguments provided)" which i have no idea what it means, and googling the error does not yield any results.
Any thoughts or ideas ?
Open the .vcxproj file for the project in a text editor and see if under the emscripten build configurations there are tags that are not relevant.
For example I had a "ResourceCompile" tag which always led to an error regarding rc.exe being missing.
Similarly I also had "BrowseInformation" tags.
This happens when you create your Emscripten configuration from an configuration which had these additional tags for example x64. Probably a bug in vs-tools. Ideally it should be skipping these tags.
When i am trying to Build my default JavaScript project(BlankApp Apache Cordova) in Visual Studio 2015 preview am getting following error.
The TypeScript Compiler was given no files for compilation, so it will skip compiling.
Steps Taken in visual studio 2015 preview:
File -> New -> Project -> Apache Cordova apps(under Javascript templates).
Run the default project with Android Emulator.
Getting the following error.
Warning 2 The TypeScript Compiler was given no files for compilation, so it will skip compiling. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets 97 5 BlankCordovaApp4
This is a known issue in the CTP3 release. It sounds like you've created a JS-based project, and have not added any TypeScript files, and so of course there are no .ts (aka TypeScript) files passed to the compiler. Ideally the compiler wouldn't be run at all, but the warning is harmless, and everything else should otherwise be working.
You need to make sure that at least one of your TypeScript files is marked with the TypeScriptCompile build action.
If you click on the file and check the properties window in Visual Studio you will see the build action - it may be that they are all set to some other action.
Option 1:
Take Project offline, edit project, remove the following lines:
<Import
Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props"
Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')"/>
and
<Import
Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets"
Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')"
/>
Option 2:
Change "AddTypeScriptReferencePath": true to false in Webessentials-Settings.json
It seems that there is no type script file available to compile. add a blank type script file under script folder and then compile, it should work.
This warning was driving me nuts with ASP.NET 5 (asp.net core 1). If you double click the warning you open the Microsoft.TypeScript.targets file. Delete the line with CompileTypeScript and the warning goes away. I'm assuming this prevents TypeScript from compiling normally, which is fine by me as I don't want it anyway.
<PropertyGroup>
<CompileDependsOn>
CompileTypeScript; <--- delete this line
$(CompileDependsOn);
</CompileDependsOn>
I had the same issue.
Mine was due to missing system variable to nodejs. Check your visual studio output. If it is not recognizing “node” command, add system variable.
Computer->right click-> properties -> advanced system settings -> Environment Variable
Check “path” under user variables and system variables
Add the nodejs path to it. Ie: C:\Program Files (x86)\nodejs
I hope someone can help me, I was trying to do following tutorial about automatic creation of nuget packages:
http://msdn.microsoft.com/en-us/vs2010trainingcourse_aspnetmvcnuget_topic2
I made following batch file:
#echo off
..\BUILD\NuGet\NuGet.exe pack .\defs.nuspec -OutputDirectory ..\BUILD\myPackages
I can run this file from explorer or shell without problems. When I try to call this batch from the Post_Build event handler of VS2010: (Post-Build event command line)
call "$(ProjectDir)CreateNuGetPackage.bat"
It always return:
Error 47 The command "call "C:\development\mysolution\myproject\CreateNuGetPackage.bat"" exited with code 1.
Even if this path is right.
I even try to make a .cmd file with the same content which also generated the NuGet package without problems but not within the Post-Build dialog. I've also tried to put the content of the bath in the Post-Build event dialog (as defined in the article):
C:\development\mysolution\myproject\..\BUILD\NuGet\NuGet.exe pack C:\development\mysolution\myproject\defs.nuspec -OutputDirectory C:\development\mysolution\myproject\..\BUILD\myPackages
And I'm still getting the same error... I really have no clue what can be going wrong, I hope someone can help me or give me an alternative way of generating such packages.
Thanks!!
I finally ended up solving the problem: I had to copy an instance of Nuget to the folder where my solution lies. Even if Nuget was in the path. I still don't know why VS was not able to find nuget if started from a post-build event (I'm not using nuget anymore, it doesn't fit my needs as I was expecting something similar to maven).