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

Building solution with vs2022 fails #54162

Closed
matshou opened this issue Jan 8, 2022 · 9 comments · Fixed by #54170
Closed

Building solution with vs2022 fails #54162

matshou opened this issue Jan 8, 2022 · 9 comments · Fixed by #54170
Labels
Code: Build Issues regarding different builds and build environments <Documentation> Design documents, internal info, guides and help.

Comments

@matshou
Copy link
Contributor

matshou commented Jan 8, 2022

Describe the bug

The project fails to build when using Microsoft Visual Studio 2022.

It is not clear from compile documentation whether the latest version of VS is compatible with VCPKG:

Visual Studio 2019 (or 2015 Visual Studio Update 3 and above);

The issue seems to be caused by VCPKG as noted in microsoft/vcpkg#22287 and should be referenced in the compile documentation listed above to avoid any confusion until the issue has been resolved.

Steps to reproduce

  1. Install Microsoft Visual Studio 2022.
  2. Install VCPKG in C:\dev\vcpkg.
  3. Clone CDDA repository.
  4. Open the solution with Visual Studio.
  5. Try to build the solution.

Expected behavior

I expected the project to build without any errors.

Screenshots

No response

Versions and configuration

  • OS: Windows 10
  • Game Version: 0.F-5047-g1849155482

Additional context

Build started...
1>------ Build started: Project: Cataclysm-lib-vcpkg-static, Configuration: Debug x64 ------
1>Get version string
1>Done
1>Generating "version.h"...
1>VERSION defined as "0.F-5012-g11cfa830c7-dirty"
1>Installing vcpkg dependencies to D:\Projects\Cataclysm-DDA\msvc-full-features\vcpkg_installed\
1>"C:\dev\vcpkg\scripts\buildsystems\msbuild\..\..\..\vcpkg.exe" install  --x-wait-for-lock --triplet "x64-windows-static" --vcpkg-root "C:\dev\vcpkg\scripts\buildsystems\msbuild\..\..\..\\" "--x-manifest-root=D:\Projects\Cataclysm-DDA\msvc-full-features\\" "--x-install-root=D:\Projects\Cataclysm-DDA\msvc-full-features\vcpkg_installed\\" --clean-after-build
1>No suitable Visual Studio instances were found
1>C:\dev\vcpkg\scripts\buildsystems\msbuild\vcpkg.targets(104,5): error MSB3073: The command ""C:\dev\vcpkg\scripts\buildsystems\msbuild\..\..\..\vcpkg.exe" install  --x-wait-for-lock --triplet "x64-windows-static" --vcpkg-root "C:\dev\vcpkg\scripts\buildsystems\msbuild\..\..\..\\" "--x-manifest-root=D:\Projects\Cataclysm-DDA\msvc-full-features\\" "--x-install-root=D:\Projects\Cataclysm-DDA\msvc-full-features\vcpkg_installed\\" --clean-after-build" exited with code 1.
1>Done building project "Cataclysm-lib-vcpkg-static.vcxproj" -- FAILED.
2>------ Build started: Project: JsonFormatter-lib-vcpkg-static, Configuration: Debug x64 ------
3>------ Build started: Project: Cataclysm-test-vcpkg-static, Configuration: Debug x64 ------
4>------ Build started: Project: Cataclysm-vcpkg-static, Configuration: Debug x64 ------
2>LINK : fatal error LNK1181: cannot open input file 'D:\Projects\Cataclysm-DDA\Cataclysm-lib-vcpkg-static-Debug-x64.lib'
2>Done building project "JsonFormatter-lib-vcpkg-static.vcxproj" -- FAILED.
5>------ Build started: Project: JsonFormatter-vcpkg-static, Configuration: Debug x64 ------
5>LINK : fatal error LNK1104: cannot open file 'D:\Projects\Cataclysm-DDA\Cataclysm-lib-vcpkg-static-Debug-x64.lib'
5>Done building project "JsonFormatter-vcpkg-static.vcxproj" -- FAILED.
3>stdafx.cpp
4>stdafx.cpp
3>D:\Projects\Cataclysm-DDA\msvc-full-features\stdafx.h(80,16): fatal error C1083: Cannot open include file: 'SDL2/SDL.h': No such file or directory
4>D:\Projects\Cataclysm-DDA\msvc-full-features\stdafx.h(80,16): fatal error C1083: Cannot open include file: 'SDL2/SDL.h': No such file or directory
4>Done building project "Cataclysm-vcpkg-static.vcxproj" -- FAILED.
3>Done building project "Cataclysm-test-vcpkg-static.vcxproj" -- FAILED.
========== Build: 0 succeeded, 5 failed, 0 up-to-date, 0 skipped ==========
@matshou
Copy link
Contributor Author

matshou commented Jan 8, 2022

@akrieger I've created this issue as a reminder to update the documentation so feel free to assign yourself.

@akrieger
Copy link
Member

akrieger commented Jan 8, 2022

Alas I lack those privileges, but I won't forget, thanks!

@BrettDong
Copy link
Member

I’m using Visual Studio 2022 right now on Windows 10 and it compiles fine for me.

@BrettDong
Copy link
Member

As your linked issue says, you just need to install VC2019 build tools and you can build the solution in VS2022 IDE.

@BrettDong BrettDong added <Documentation> Design documents, internal info, guides and help. Code: Build Issues regarding different builds and build environments labels Jan 8, 2022
@matshou
Copy link
Contributor Author

matshou commented Jan 8, 2022

As your linked issue says, you just need to install VC2019 build tools and you can build the solution in VS2022 IDE.

Is this done by selection a component from the Visual Studio installer?

@BrettDong
Copy link
Member

Is this done by selection a component from the Visual Studio installer?

Yes, in Visual Studio Installer.

@ZhilkinSerg
Copy link
Contributor

@matshou
Copy link
Contributor Author

matshou commented Jan 8, 2022

Yes that is the same document I linked and mentioned as compile documentation.

@scavtoons
Copy link

Had a similar error but in 2019, the visual studio english language pack is mandatory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Build Issues regarding different builds and build environments <Documentation> Design documents, internal info, guides and help.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants