Installing boost via vcpkg, I get the wrong toolset - c++

I recently switched from using the Visual Studio 2015 IDE to the Visual Studio 2019 IDE. Around that same time I started using vcpkg for library installations. I've been using a pre-build version of an earlier version of boost, which I compiled myself. Thinking I ought to switch to a newer version of boost using vcpkg, I installed it with:
vcpkg.exe install boost --triplet x64-windows-static
Yet when I look inside C:\dev\vcpkg\installed\x64-windows-static\lib I see that vc140 - the Visual Studio 2015 toolset - is the version of boost built. Note that I am not using cmake. I am working purely in the IDE. How do I tell vcpkg I want the vc142 toolset, the version for Visual Studio 2019, built?

The answer is a modified version of the GitHub issues,
Edit file from your VCPKG path
vcpkg\triplets\x86-windows.cmake
To add line
set(VCPKG_PLATFORM_TOOLSET v142)

Related

Can I use vcpkg without Visual Studio?

I just downloaded and configured vcpkg. But when I tried to install a package, I got this error message:
error: in triplet x64-windows: Unable to find a valid Visual Studio instance
Could not locate a complete Visual Studio instance
Does it mean it is necessary to install Visual Studio to make the vcpkg available?
Considering that all my work is doing on clion and vscode, if it's necessary, what's the minimum required components should I install?
Or maybe it's just my wrong somewhere?
No, you do not need to install Visual Studio to use vcpkg. By default, vcpkg tries to build packages with the MSVC compiler if you are on Windows. You could install just the Visual Studio Build Tools, which would give you MSVC without installing the entire IDE, if you wish.
What compiler are you currently using?
If you happen to be using MinGW, you should tell vcpkg to use that. See: https://vcpkg.io/en/docs/users/mingw.html.
Disclaimer: I work on the vcpkg tool.

CMake: EWDK is detected as VS2022 with v143 toolset when only its actually VS2019 + v142

Evening,
I am trying to get a ci pipeline working for my cs class about windows driver.
For this I am using the Enterprise WDK which is a command line build environment that does not require any installation prior to use.
See: https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/using-the-enterprise-wdk
When building the driver with msbuild from the EWDKthrough the solution file the build succeeds. On the other hand, when calling cmake it incorrectly detects EWDK as Building for: Visual Studio 17 2022 and therefore generates VCTargetsPath.vcxproj with <PlatformToolset>v143</PlatformToolset> although the EWDK is shipped with v142 and Visual Studio 2019.
When using the same CMakeList.txt with VS2019 Pro + WDK on my notebook cmake correctly detect everything correctly.
Is there any way to manually overwrite the Toolset or to point cmake in the right direction to choose the correct VS version?
Regards Artur

how to install vcpkg for vs code?

I tried to install vcpkg for VS code and in a PowerShell Window. I had this error:
Could not find MSBuild version with C ++ support. VS2015, VS2017 or VS2019 (with C ++) must be installed.
So I installed Visual studio and I have the same error. What should I do?
Run vcpkg integrate install to customize Visual Studio Code on Linux or macOS. This command sets the location of the vcpkg enum and enables IntelliSense for the source files.
Look at this web page: https://learn.microsoft.com/ru-ru/cpp/build/vcpkg?view=msvc-160#integrate-with-visual-studio-code-linuxmacos

Trying to build a Qt application with VC++ compiler: 'type_traits': No such file or directory

Why doesn't the compiler find the file? It exists in the VC include directory for VS 14.0.
I've read that in previous versions of Visual Studio, you have had to install a service pack or something, is this a similar case?
I'm using VS 2015 Community.
This seems to be resolved by running vcvarsall.bat and starting Qt Creator from the same command prompt window.
I had this same problem in Visual Studio 2019 Community with Qt 6.0.0
after, searching every forum etc.. and trying the install of Visual Studio 2015 build tools x64 and Visual Studio redistributable 2015 x64 (which didn't solve the problem too),
I tried updating Windows sdk version from 10.0.18362.0 to 10.0.19041.0 and the problem was SOLVED.
I'm currently using Visual Studio Community 4.8.03761 if that might help others
so just check that you have Window sdk version 10 updated and that your compiler is well chosen (I had mvsc2019_64 and work with LLVM etc.. version in build settings) .
hopefully this helps you guys.

Use VS2008 (v90) C++ toolset in VS2013?

MS documentation explains how to use 2010 or 2012 toolsets in VS2013.
Does anyone know if there is also backwards support for the 2008 toolset? I am upgrading several projects from 2008 to 2013 but my team lead would like us to upgrade the project files initially but still target the same compiler/runtime as 2008.
Is this possible?
The VS2008 install on its own doesn't properly setup the toolset directory/registry. This prevents later version of VS from locating the v90 tools.
If you install the VS2010 C++ compiler toolset it will include the v90 toolset as well. After doing this I am able to build in VS2013 with the VS2008 toolset. This can be done by installing VS2010 itself or installing the Windows 7.1 SDK which includes the 2010 toolsets (v90 and v100).
Reference:
MSDN
I get the option to select VS 2008 (v90) as a Platform Toolset for my VC++ projects in VS 2013. I did nothing special (other than VS 2008 was installed when I installed VS2013).