Is there a way to list library dependencies in Visual Studio? - c++

I'm trying to build a C++ project with Boost and Cinder on Windows Server 2008 with MSBuild without success. I've build the same project on my Windows 7 machine under VS2013 and MSBuild, however on the server it is saying that it can't open a library by the name of "threadsafestatics.lib"
I've never heard of threadsafestatics.lib and my Google-foo hasn't brought me any luck finding anything about it online.
Is there a way to find out what part of my project is depending on this library?

Providing debug level output for the build process helped to work around the problem:
Tools->Options->Projects and Solutions->Build and Run->MSBuild project build output verbosity

threadsafestatics.lib is a new library from the November 2013 CTP. If you are compiling with the CTP, you must add its installed lib folder to Project > Properties > VC++ Directories > Library Directories.
If you installed the CTP to its default location on a 64-bit machine, the path is C:\Program Files (x86)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib
You can also use the macros $(VC_CTP_Nov2013_LibraryPath_x86), $(VC_CTP_Nov2013_LibraryPath_x64), or $(VC_CTP_Nov2013_LibraryPath_ARM) depending on your target architecture.

If you had installed "CompilerCTP.Nov2013"Patch package, and using toolset of ctp2013,you can try to change toolset into 2013 with the following steps:
project -> property ->config property -> platform toolset ->Visual Studio 2013 (v120).

Related

The build tools for Visual Studio 2008 (Platform Toolset = 'v90') cannot be found

I'm trying to build project c++ on vs2017 but there error appear:
"The build tools for Visual Studio 2008 (Platform Toolset = 'v90') cannot be found " after navigation, I must download VS 2008 I have installed it, but problem still exist .
any Suggestion ?
You need:
An MSVC 9.0 compiler toolchain
https://wiki.python.org/moin/WindowsCompilers lists the products that have it:
VS 2008, "Visual C++" feature and "x64 compilers and tools" subfeature
Express edition only has x86 compilers
Do install SP1 on top of VS2008 -- in vanilla VS2008 installer, installation for many features, including x64 compilers, is broken
WinSDK 6.1
WinSDK 7.0
"Visual C++ Compiler for Python 2.7" package
MsBuild 4.0 toolset configuration files for the above toolchain. (These are the directories c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\<arch>\PlatformToolsets\v90\ with .props and .targets files in them)
The only product I know that has this package is VS 2010 ("Visual C++" feature and "x64 compilers and tools" subfeature).
(WinSDK 7.1 technically has it, too, but its setup is riddled with bugs and broken on an x64 system.)
(You can bypass the buggy installer though if you install <GRMSDK_EN_DVD.iso>\Setup\vc_stdx86\vc_stdx86.msi directly. Despite the name, it has toolset files for all 3 platforms.)
"Visual C++ Compiler for Python 2.7" package is not supported by these toolset configuration files. So if you use it, you'll need to either manually specify its location in one of registry values specified in .props, or modify .props to also look in HKLM\Software\Microsoft\DevDiv\VCForPython.
The projects are targeting the v90 platform toolset. The solution is to either open the .sln file with VS2008 (i.e. use the right tool), or spend some time updating the projects to target the latest platform toolset (i.e. VS2017). To do that, just right click each project, and go to Properties, then look at General | Windows SDK Version. You may have to fix compilation / linker errors following the project upgrade.
It is possible to upgrade the project file from the command line without opening it in Visual Studio. I was running into the same issue, and found another solution in the Microsoft documentation for Visual Studio (https://learn.microsoft.com/en-us/visualstudio/ide/reference/upgrade-devenv-exe?view=vs-2017).
Here are the steps:
Open the developer command prompt for you version of Visual Studio, e.g. 'Developer Command Prompt for VS 2017'.
Navigate to the directory of your project file.
Execute the following command: devenv myproject.sln /upgrade

Opening VS 2012 C++ Project in VS 2015 gives Build error

We have a C++ Project built in VS 2012 (To generate .arx files to work with AutoCad 2014). Now we need to recompile it in VS 2015. we have not installed VS 2012. I opened the project in VS 2015. Properties -> General -> Platform toolset is set to Visual Studio 2015 (v140). Still we are getting "The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools."
we created a simple C++ Console application and ran it. Works fine no build error there.
Need to recompile the files for building .arx files to work in AutoCad 2018.
Initial Project Load :->
In the initial project load itself for Nimcad and planact we are getting build tools error. But not for engr.
Build on engr Project getting errors this might be the changes in ObjectARX 2018 I don't know. If you have a solution for this error please let us know:->
Buid on Nimcad Project :->
Build on Planact Project :->
For both Nimcad and planact all we get is build tools error.
Property Pages :
Any help please.
To build AutoCAD 2018 ObjectARX app you'll need Visual Studio 2015 Update 3 configured (by default) with VC14.0. As you are migrating a project, make sure to adjust all libraries (.lib files) to version 22. Did you download the ObjectARX 2018 SDK?
Update
This seems a problem with your Visual Studio installation. If you create a new C++ project, VS should also ask you to install the missing parts.
In Visual Studio 2015 (...) the C++ compiler, libraries, and project templates have been moved into an optional feature. (...) To install the various components needed for desktop and mobile development in C++, you must choose “Custom” and manually select those items (Visual C++ Team Blog)
You may need to re-run VS setup and select the C++ related parts (as already mentioned on the question comments).
Finally, check your VisualStudioVersion using the VS2015 Command Prompt:

MSBuild configuration error WDK 8.1 Visual Studio 2015 to build kernel mode driver

I'm struggling with VS 2015 C++ 'Platform Toolset' configuration property to build a test *.sys kernel driver I want play around this night.
So, this is a fresh new installation of VS 2015 Pro (update 1) plus WDK 8.1 (just downloaded) running on clean Win 8.1
All libs and headers like ntddk.h are in place.
But C++ Solution Explorer -> General -> Platform Toolset does not eat every option:
Visual Studio 2015 (v140) -- ok
Visual Studio 2015 - Windows XP (v140_xp) -- ok
WindowsApplicationForDrivers8.1 -- error
WindowsKernelModeDriver8.1 -- error (need this one)
WindowsUserModeDriver8.1 -- error
Nags as follows:
One or more values are invalid. MSBuild returned the following error:
The imported project "C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\v120\Microsoft.cpp.props" was not
found. (Directory exists though!) Confirm that the path in the
declaration is correct, and that the file exists on disk.
C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Redirect.12.props
I don't know what it could be. Am I supposed to have WDK 10 towards to VS2015?!
Anyway, I need the ability to build the driver on VS 2015.
Could it be directed compiler scripts?
Any ideas?
Ok
Moving to WDK 10 helped!
https://msdn.microsoft.com/en-us/windows-drivers/develop/building_a_driver
Ensure that you have the same version of SDK and WDK installed on your
computer.
You need to install the driver update for visual studio if you are working on visual studio then you have to get the proper update for it. I've a link please follow this link and you will get rid off from this problem..enter link description here
enter link description here

MSbuild Error: The builds tools for v140 (Platform Toolset = 'v140') cannot be found

I have a solution which is consists of a large number of projects (C++ and C#). I upgraded the solution to VS2015, so the toolset version for most of them are now set to V140, but a small number of projects need to remain in V110 (third party libraries, etc). When I build the solution in Visual Studio 2015, it builds just fine, but when TeamFoundationServer tries to build it, it fails with the following error:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets (44): The builds tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install v140 to build using the v140 build tools.
I tried to specify the VisualStudioVersion or the path to the right MSBuild version as build arguments, but it didn't work as the rest of the projects (the ones in V110) will be in trouble.
Any help would be very appreciated.
I had the same issue. Steps given in this Solution helped me solve my issue. Repeating the steps here for future reference.
If you're attempting to build a Win32 "Desktop" application, the easiest way to get the v140 Platform Toolset is via the Visual Studio Installer (please see the image, below, for an illustration of steps '3.' and '4.'):
Launch the "Visual Studio Installer" from your start menu.
Select "Modify" for the instance of Visual Studio 2017 you have
installed.
Under the "Summary" pane of the workload selector, click the
"Desktop development with C++" expander (if it is collapsed)
Check the "VC++ 2015.3 v140 toolset (x86,x64)" optional feature.
The builds tools for v140 that's the platform toolset for VS2015.
If you are using TFS2015, you must make sure the build environment on your build machine be the same as your local developer machine. You should install VS2015 on your build machine.
If you are using TFS2013 or TFS2012, most probably MSBuild 12.0 is called.You need to set the build templates to point to MS Build version 14.0. For the details, check: TFS 2013 building .NET 4.6 / C# 6.0
Jacob's answer worked for me but C++ build tools were under VS Build Tools 2017 while I had VS 2019 Installer on Windows 10 as at July, 2019.
You're trying to build using a different version of the build toolset that is either not installed on your system or that the project can't use. To change it to something that you have installed on your system, right click on the project in your Solution Explorer.
Go to Properties. Configuration Properties>General>Platform Toolset>(Change this to a toolset that is installed on your system).
Make sure you do this for the Debug and Release builds
For the folks who are trying to do the same with Visual Studio Build Tools 2022, you may find this under Optional when choosing Desktop development with C++ Workload. Also, I had to update below variables in Environment variables to point to the new location.
Path: replace previous path for BuildTools with C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
VCTargetsPath: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170
VS140COMNTOOLS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ PS: I didn't have to change the value. But this setting was needed for me to work.
If you are using Visual Studio 2022 Build Tools, then the following PowerShell script will fix it:
$VS_BTOOLS_EXE="vs_buildtools.exe"
$VS_BTOOLS_URI="https://aka.ms/vs/17/release/vs_buildtools.exe"
Invoke-WebRequest -Uri $VS_BTOOLS_URI -OutFile $VS_BTOOLS_EXE
Start-Process -FilePath ./vs_BuildTools.exe -ArgumentList `
"--add", "Microsoft.VisualStudio.Component.VC.140", `
"--quiet", "--norestart", "--force", "--wait" -Wait -PassThru
Useful when silent installation is needed as well.
Jacob's answer worked for me, but I had to click on the "Individual components" tab at the top for my Step 3.
image
This solution worked perfectly for me: https://social.msdn.microsoft.com/Forums/vstudio/en-US/e0b9c601-2ece-4dcc-bac3-23ed7dd6801a/the-builds-tools-for-v120-platform-toolset-v120-cannot-be-found?forum=vclanguage

Visual Studio 2012 using platform toolset v100. Cannot open source file "atlbase.h"

I am using Visual Studio Ultimate 2012. I have a project that works when i use the default v110 platform toolset.
Now I would like to add the Point Cloud Library (PCL) to this project to further work on it. Unfortunately there are only binaries available for Visual Studio 2010. I first tried to compile the 2012 binaries myself but that turned out to be more trouble than its worth. So i changed my platform toolset to v100 in order to use the PCL prebuilt binaries.
However, when doing so, one of my includes (atlbase.h) is no longer recognized. I have tried to manually include this by adding the Include and Library Directories of ATL in the project properties. This generated a whole lot of new errors, originating from the atl header files, which seems odd. I have also tried changing the option "Use of ATL" to "Dynamic Link to ATL" and "Static Link to ATL" from the default "Not Using ATL" to no avail.
I'm working on a 64 bit Windows 7 Ultimate machine and want to compile in 32 bit.
Edit: Using Process Monitor I have found that Visual Studio is looking for the include file in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\atlbase.h.
This folder (..\atlmfc) does not exist.
My VS2012 is installed at D:\School Programs\Visual Studio 2012
Is there a fix for this?
When you Switch to another different toolset this complete toolset must be available. This includes also the header files.
It should be possible without great Trouble to convert this DLL into VS 2012. Or myabe you can include the complete source without using a separate DLL.
Download and install WDK 7.1 (microsoft.com/en-us/download/confirmation.aspx?id=11800)
Create an environment variable which points to the installation directory, I called mine WINDDK
Go to project Properties -> VC++ Directories
Add $(WINDDK)\inc\atl71 to Include Directories
Add $(WINDDK)\lib\ATL\i386 to Library Directories (this is for 32 bit)
Go to project Properties -> Linker -> Input
Add atl.lib to Additional Dependencies
These steps have solved my problem