Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to switch the visual studio version? #1234

Closed
mp5557 opened this issue Jun 7, 2017 · 4 comments
Closed

How to switch the visual studio version? #1234

mp5557 opened this issue Jun 7, 2017 · 4 comments
Labels
category:documentation To resolve the issue, documentation will need to be updated

Comments

@mp5557
Copy link

mp5557 commented Jun 7, 2017

I have both VS2015 and VS2017. The default VS version of vcpkg is VS2017. Is there any method to switch the VS version of vcpkg? Thanks.

@MVoz
Copy link
Contributor

MVoz commented Jun 7, 2017

edit, как пример
vcpkg\triplets\x86-windows.cmake
add, строку
set(VCPKG_PLATFORM_TOOLSET v140)

echo set(VCPKG_PLATFORM_TOOLSET v140) >> triplets\x86-windows.cmake

профит )

@ras0219-msft ras0219-msft added the category:documentation To resolve the issue, documentation will need to be updated label Jun 7, 2017
@ras0219-msft
Copy link
Contributor

Hi @mp5557,

Take a look at our triplet documentation: https://vcpkg.readthedocs.io/en/latest/users/triplets/. Basically, you can create a new triplet that has

set(VCPKG_PLATFORM_TOOLSET v140)

and we'll use VS2015 to build the libraries inside that triplet.

Note that VS2017 and VS2015 are binary compatible, so ideally you shouldn't need to do this, but we definitely have the escape hatch for when things go wrong.

@magicfoo
Copy link

magicfoo commented Jan 2, 2020

VS2017 and VS2019 are not: error LNK2001: unresolved external symbol ___CxxFrameHandler4

@walbourn
Copy link
Member

VS2017 and VS2019 are not: error LNK2001: unresolved external symbol ___CxxFrameHandler4

VS 2015 Update 3 - VS 2022 ARE binary compatible, but specifically you have to LINK with the latest version of the MSVC Runtime. You can use a mix of static C/C++ libraries built with VS 2015 Update 3, VS 2017, VS 2019, and/or VS 2022, but you must LINK it with the newest one in the mix (i.e. VS 2022). See Microsoft Learn.

The symbol ___CxxFrameHandler4 was added in Visual Studio 2019 and is related to the new x64 exception handling implementation. You can disable this with /d2FH4-.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:documentation To resolve the issue, documentation will need to be updated
Projects
None yet
Development

No branches or pull requests

6 participants