Cant compile for x64 even after installing Visual C++ 2008 Express and Windows SDK - c++

I have Visual C++ 2008 Express Edition installed. From here I have installed the MICROSOFT WINDOWS SOFTWARE DEVELOPMENT KIT FOR WINDOWS 7 and .NET FRAMEWORK 4 for x64 bit compile.
Now I can see the option of x64 through IDE in configuration menu. But whenever I try to build with this Debug|x64 selected, all I get is:
========== Build: 0 succeeded or up-to-date, 0 failed, 1 skipped ==========
It never gets build and always fails.
I also don’t have amd64\vcvarsamd64.bat folder inside C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin
Even when trying to build from cmd through msbuild "[PROJECT_PATH].sln" /t:Clean,Build /p:Configuration=Debug;Platform=x64 I get this:
Microsoft (R) Build Engine Version 3.5.30729.5420
[Microsoft .NET Framework, Version 2.0.50727.5420]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
Build started 11/4/2016 11:55:00 AM.
Project "[PROJECT_PATH].sln" on node 0 (Clean;Build target(s)).
Building solution configuration "Debug|x64".
vcbuild.exe : error VCBLD0004: Project '[PROJECT_PATH].vcproj' does not contain a configuration called 'Debug|x64'.
vcbuild.exe : error VCBLD0004: Project '[PROJECT_PATH].vcproj' does not contain a configuration called 'Debug|x64'.
vcbuild.exe : error VCBLD0004: Project '[PROJECT_PATH].vcproj' does not contain a configuration called 'Debug|x64'.
Done Building Project "[PROJECT_PATH].sln" (Clean;Build target(s)) -- FAILED.
Build FAILED.
Seems like tools aren’t installed but I have installed Windows SDK after selecting the compile tools, then why it isn’t?
Any idea what went wrong?

The Windows SDK does not include any C++ compiler, and VC++ 2008 Express edition is 32 bit only. You need to install a 64 bit compiler (more recent versions of VC++ Express are available in 64 bit flavor).

Related

CMake can't get the value of VCTargetsPath when generating for UWP

I'm trying to use CMake to build a Universal Windows App, but I get the following build error (latest Visual Studio 2019 and Windows 10 SDK are installed):
› cmake -B. -H<my source dir> -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 16.5.1+4616136f8 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 5/16/2020 9:52:00 PM.
Project "C:\test\CMakeFiles\3.17.2\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(777,5): error : The OutputPath property is not set for project 'VCTargetsPath.vcxproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='x64'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [C:\test\CMakeFiles\3.17.2\VCTargetsPath.vcxproj]
Done Building Project "C:\test\CMakeFiles\3.17.2\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\test\CMakeFiles\3.17.2\VCTargetsPath.vcxproj" (default target) (1) ->
(_CheckForInvalidConfigurationAndPlatform target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(777,5): error : The OutputPath property is not set for project 'VCTargetsPath.vcxproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='x64'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [C:\test\CMakeFiles\3.17.2\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.07
Exit code: 1
-- Configuring incomplete, errors occurred!
What does that mean? I've also tried to specify the exact Windows SDK version for CMAKE_SYSTEM_VERSION, but no luck.
I solved the problem. I did many things, therefore I cannot tell which one exactly solved the problem. But try the following.
From VisualStudio Installer app, click Modify and install C++ Universal Windows Platform support for v142 build tools (ARM64) individual component.

Building Visual Studio 2015 C++ project (v140) by MSBuild Failed - v140 cannot be found

I have Visual Studio 2013 and 2015 installed side by side. I have just upgraded the combined solution (C#, C++, C++/CLI) to 2015 and set Platform Toolset to v140.
The build from Visual Studio works fine, but it cannot be compiled from MSBuild. I use MSBuild 14 and MSBuild complains that is unable to find v140, but it is nonsense, because v140 is installed on the computer in "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140".
The advice about upgrading the solution cannot be done, because the solution is already upgraded and there is no such item in solution context menu.
If I switch Platform tools of the project to v120, it works.
Details:
c:\git\hewerMaster>"c:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" c:\git
\hewerMaster\Hewer.sln /property:Configuration=Debug /property:Platform=x86
Microsoft (R) Build Engine version 14.0.23107.0
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
Build started 9/12/2015 4:00:25 PM.
Project "c:\git\hewerMaster\Hewer.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Debug|x86".
ValidateProjects:
The project "HewerDotNetWrapper" is not selected for building in solution con
figuration "Debug|x86".
The project "VisualHewer" is not selected for building in solution configurat
ion "Debug|x86".
The project "UnitTestWrapper" is not selected for building in solution config
uration "Debug|x86".
The project "ParamsFormatConverter" is not selected for building in solution
configuration "Debug|x86".
The project "UnitTestGenerator" is not selected for building in solution conf
iguration "Debug|x86".
The project "HewerUnitTestDotNet" is not selected for building in solution co
nfiguration "Debug|x86".
Project "c:\git\hewerMaster\Hewer.sln" (1) is building "c:\git\hewerMaster\Hewe
rRedirect\HewerRedirect.csproj" (2) on node 1 (default targets).
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with resp
ect to the input files.
_CopyAppConfigFile:
Skipping target "_CopyAppConfigFile" because all output files are up-to-date wi
th respect to the input files.
CopyFilesToOutputDirectory:
HewerRedirect -> c:\git\hewerMaster\anyCPU\Debug\pbrain-hewer.exe
Done Building Project "c:\git\hewerMaster\HewerRedirect\HewerRedirect.csproj" (
default targets).
Project "c:\git\hewerMaster\Hewer.sln" (1) is building "c:\git\hewerMaster\Hewe
r\Hewer.vcxproj" (3) on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.t
argets(64,5): error MSB8020: The build tools for v140 (Platform Toolset = 'v140
') cannot be found. To build using the v140 build tools, please install v140 bu
ild tools. Alternatively, you may upgrade to the current Visual Studio tools b
y selecting the Project menu or right-click the solution, and then selecting "U
pgrade Solution...". [c:\git\hewerMaster\Hewer\Hewer.vcxproj]
Done Building Project "c:\git\hewerMaster\Hewer\Hewer.vcxproj" (default targets
) -- FAILED.
Done Building Project "c:\git\hewerMaster\Hewer.sln" (default targets) -- FAILE
D.
Build FAILED.
UPDATE:
There are some project being skipped form Debug X86. This is intentional.
The project have been originally created in VS2008, then upgraded to VS2013, then upgraded to VS2015.
There are two Visual Studios installed on this computer (2013 Community and 2015 Community). 2013 was installed first, 2015 later.
The registry settings looks like:
UPDATE2:
Minimal, Complete, and Verifiable example
I have created empty C++ Console Application in Visual Studio 2015:
https://dl.dropboxusercontent.com/u/53387801/ConsoleApplication_v140.zip
#include "stdafx.h"
int main()
{
return 0;
}
I can build it in Visual Studio, but I face the same issue in MSBuild:
c:\>"c:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild" "C:\temp\vs2015_simplest\C
onsoleApplication1\consoleApplication1.sln"
Microsoft (R) Build Engine version 14.0.23107.0
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
Build started 9/16/2015 10:16:20 AM.
Project "C:\temp\vs2015_simplest\ConsoleApplication1\consoleApplication1.sln" o
n node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Debug|x64".
Project "C:\temp\vs2015_simplest\ConsoleApplication1\consoleApplication1.sln" (
1) is building "C:\temp\vs2015_simplest\ConsoleApplication1\ConsoleApplication1
\ConsoleApplication1.vcxproj" (2) on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.t
argets(64,5): error MSB8020: The build tools for v140 (Platform Toolset = 'v140
') cannot be found. To build using the v140 build tools, please install v140 bu
ild tools. Alternatively, you may upgrade to the current Visual Studio tools b
y selecting the Project menu or right-click the solution, and then selecting "U
pgrade Solution...". [C:\temp\vs2015_simplest\ConsoleApplication1\ConsoleApplic
ation1\ConsoleApplication1.vcxproj]
Done Building Project "C:\temp\vs2015_simplest\ConsoleApplication1\ConsoleAppli
cation1\ConsoleApplication1.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\temp\vs2015_simplest\ConsoleApplication1\consoleAppli
cation1.sln" (default targets) -- FAILED.
Build FAILED.
"C:\temp\vs2015_simplest\ConsoleApplication1\consoleApplication1.sln" (default
target) (1) ->
"C:\temp\vs2015_simplest\ConsoleApplication1\ConsoleApplication1\ConsoleApplica
tion1.vcxproj" (default target) (2) ->
(PlatformPrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform
.targets(64,5): error MSB8020: The build tools for v140 (Platform Toolset = 'v1
40') cannot be found. To build using the v140 build tools, please install v140
build tools. Alternatively, you may upgrade to the current Visual Studio tools
by selecting the Project menu or right-click the solution, and then selecting
"Upgrade Solution...". [C:\temp\vs2015_simplest\ConsoleApplication1\ConsoleAppl
ication1\ConsoleApplication1.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.14
c:\>
SOLVED:
Environment variable VisualStudioVersion was set to 12.0 instead of 14.0 Changing the value to 14.0 solved the issue.
The simple console application started to work immediately after the Environment variable VisualStudioVersion changed and after windows logout, login.
The original project still couldn't be build after changing environment variable VisualStudioVersion. A retarget solution context menu appeared in Visual Studio 2015. So I retarget the solution. After retargeting the solution still couldn't be compiled (v140 not found). Finally I changed the platform toolset from v140 (not installed) to Visual Studio 2015 (v140). Now the solution can be compiled from Visual Studio and MSBuild as well.
Your problem is that you set the environment variable VisualStudioVersion to 12.0. This tells MSBuild to use the Visual Studio 2013 (V120) tools, which don't support the Visual Studio 2015 (V140) build tools. If you unset this environment variable, or pass the /p:VisualStudioVersion=14.0 option to MSBuild your project, should build. (Or at least get past this error).
You can find more information about the VisualStudioVersion variable in a MSDN blog entry titled Visual Studio project compatibility and VisualStudioVersion.
One solution is that you can simply change the platform toolset that is available in your system. Then it build fine.

Compiling in VS 2013 Using compiler tools v90 error

I ran into a problem which everytime i try to compile just a test project with windows 2013 using v90 compiler tools, i get this error:
1>------ Build started: Project: Test Console App, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.targets(62,5): error : Required file "" is missing.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
It works fine if i compile it using VS 2008, but I feel more confortable with visual studio 2013 or 2012, Intellisence is much better, as well as the colors, etc...
I installed the windows 7.1 SDK, as well as the update pack with the 2010 Compiler tools. I have both VS 2008 and VS 2013, as well as all the C++ Redists.
I can't compile the projects I'm working on, since we have libs compiled with 2008 to which we don't have the sources to, giving us linker errors.
Thanks
The answer was to have visual studio 2010 installed. Express worked nicely.
Just for other people with the same problem, here is what you do:
Install VS 2013/2012 depending on which one you want.
Install VS 2008 and 2010 ( can be express ).
If that doesnt pick up your compiler tools v90/v100 then just follow these instructions:
-Uninstall all C++ 2010 Redists if any, or SDK 7.1 won't install.
-Install Windows SDK 7.1 and then download the Windows C++ Compiler Tools 2010 update for the SDK.
-Install the C++ Redists again.
-Reboot.
-Enjoy! :P

How Debug File System Minifilter Driver on WDK 7.1

I download WDK 7.1 [because WDK8.1 Update not downloaded and stay 0% on instillation].
I wanna debug File System Minifilter Driver with WDK 7.1 - but when i debug on Win7 Debug i have an error.
Error:
error MSB8020: The build tools for WindowsApplicationForDrivers8.1 (Platform Toolset = 'WindowsApplicationForDrivers8.1') cannot be found. To build using the WindowsApplicationForDrivers8.1 build tools, please install WindowsApplicationForDrivers8.1 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...". C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets 64 5 minispy (User\minispy)
You need WDK8.1 for that, MS samples aren't compatible with older WDK releases. This sample requires VS2013 (as stated in the referenced page) and VS2013 is coupled with WDK8.1.

Visual Studio 2013: CL.exe exited with code -1073741515

I have a fresh Windows 8.1 Pro x64 install with a fresh Visual Studio 2013 Pro.
When trying to compile a project with Platform Toolset to Windows7.1SDK I'm getting
Error 1 error MSB6006: "CL.exe" exited with code -1073741515. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.targets 57 5 MenuBrowser
I tried running the supplied "Windows SDK Configuration Tool" and besides getting an error about Visual Studio 2005 and 2008 not being installed I think it did its job.
I tried manually editing the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows
where I manually put CurrentInstallFolder as C:\Program Files\Microsoft SDKs\Windows\v7.1\ and CurrentVersion as 7.1.7600.0.30514. If I look at the project properties and click the different paths / variables in there -> more -> Macros, I can see that $(WindowsSdkDir) is correct.
Any idea as to what I should try? Never ran into this problem on the old development computer with Windows 7 and VS 2012.
L.E. as a note, if I try a new project with the v120 tools, it works, but I need the Windows7.1SDK tools.
When trying to compile a project with Platform Toolset to Windows7.1SDK...
That's not a valid selection in a "fresh" install for VS2013. Not very clear what you've been doing, it certainly isn't "fresh" anymore. Do treat Regedit.exe as a loaded weapon, the registry key set that configures VS has been getting pretty doggone convoluted as of late.
The compiler crashes with -1073741515 == 0xC0000135 == STATUS_DLL_NOT_FOUND. That's a pretty serious mishap of course, it should never occur when you target SDK 7.1 since that still uses the same compiler, only the SDK directory is changed. The compiler itself, as well as the DLLs it uses, are not part of the SDK and only are provided if the machine doesn't have VS installed. You can use SysInternals' Process Monitor to diagnose this, you'll see the CL.EXE process searching for a DLL and not finding it.
The correct way to target 7.1 is to use the v120_xp toolset selection. That builds programs that can still run on XP, it automatically also selects the 7.1A SDK that was installed on your machine. Do try to undo the changes you've made.
Referencing Yodans solution from
How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?:
As pointed out by Hans Passant cl.exe looks for mspdb100.dll (among others) and does not find them.
The needed files are in the directory mentioned in 7. below:
My working setup:
VS2013 needs to use VS2010 libs
Using WinSDK 7.1 build tools (v100) in VS2013
clean install, uninstalling everything mentioned in the sdk release notes (can be downloaded at http://www.microsoft.com/en-us/download/details.aspx?id=8279 under category Details)
Microsoft Windows SDK for Windows 7 (7.1) (the Windows SDK core-component files)
Application Verifier
Debugging Tools for Windows
Windows Performance Toolkit
Microsoft Help Viewer 1.0
Microsoft Visual C++ 2010 Redistributable
Microsoft Visual C++ 2010 Standard Edition
Additionally removed all .NET and VC++ related MS Software (not tested if necessary)
choosing Windows7.1SDK as Platform Toolset in VS2013
error MSB6006: "CL.exe" exited with code -1073741515
cl.exe looks for one of msobj100.dll, mspdb100.dll, mspdbcore.dll and mspdbsrv.exe
Added to PATH: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
Build works and binary is usable!
A mistake I did:
copied files in 6. above to C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin, believing this directory is in PATH, but it was not!
So better do as sugested in 7. above or by Yodan in How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?
The following steps work for me in VS 2017.
1.Close VS 2017.
2.Restart machine.
3.Open solution in VS 2017.
4.Build the project.
This time I didn't get following error and it builds successfully.
error msb6006 "link.exe" exited with code -1073741819.