PowerShell / Win32-OpenSSH

Win32 port of OpenSSH
7.2k stars 739 forks source link

Build fails In fresh install of Visual Studio Community 2022 #2187

Closed steverollins closed 6 months ago

steverollins commented 6 months ago

Prerequisites

Steps to reproduce

I've followed the instructions given here to install and configure Visual Studio Community. I've downloaded and opened the latest build and have attempted to build the project but it shows 9 errors.

Expected behavior

Build of package should complete.

Actual behavior

Fails with the following errors:

------ Build started: Project: ssh-keyscan, Configuration: Release x64 ------
LINK : fatal error C1047: The object or library file 'C:\Temp\openssh-portable-9.4.0.0\openssh-portable-9.4.0.0\contrib\win32\openssh\\ZLib\bin\x64\\zlib.lib' was created by a different version of the compiler than other objects like 'x64\Release\ssh-keyscan\ssh-keyscan.obj'; rebuild all objects and libraries with the same compiler
LINK : fatal error LNK1257: code generation failed
Done building project "ssh-keyscan.vcxproj" -- FAILED.
------ Build started: Project: unittest-kex, Configuration: Release x64 ------
LINK : fatal error C1047: The object or library file 'C:\Temp\openssh-portable-9.4.0.0\openssh-portable-9.4.0.0\contrib\win32\openssh\\ZLib\bin\x64\\zlib.lib' was created by a different version of the compiler than other objects like 'x64\Release\unittest-kex\tests.obj'; rebuild all objects and libraries with the same compiler
LINK : fatal error LNK1257: code generation failed
Done building project "unittest-kex.vcxproj" -- FAILED.
------ Build started: Project: sshd, Configuration: Release x64 ------
LINK : fatal error C1047: The object or library file 'C:\Temp\openssh-portable-9.4.0.0\openssh-portable-9.4.0.0\contrib\win32\openssh\\ZLib\bin\x64\\zlib.lib' was created by a different version of the compiler than other objects like 'x64\Release\sshd\audit-bsm.obj'; rebuild all objects and libraries with the same compiler
LINK : fatal error LNK1257: code generation failed
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1151,5): error MSB6006: "link.exe" exited with code 1257.
Done building project "sshd.vcxproj" -- FAILED.
------ Build started: Project: ssh, Configuration: Release x64 ------
LINK : fatal error C1047: The object or library file 'C:\Temp\openssh-portable-9.4.0.0\openssh-portable-9.4.0.0\contrib\win32\openssh\\ZLib\bin\x64\\zlib.lib' was created by a different version of the compiler than other objects like 'x64\Release\ssh\clientloop.obj'; rebuild all objects and libraries with the same compiler
LINK : fatal error LNK1257: code generation failed
Done building project "ssh.vcxproj" -- FAILED.
========== Build: 1 succeeded, 4 failed, 19 up-to-date, 0 skipped ==========
========== Build completed at 11:53 and took 26.589 seconds ==========

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.17763.5122
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.5122
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version

OpenSSH v9.4.0.0

Visuals

No response

tgauth commented 6 months ago

@steverollins - please see https://github.com/PowerShell/Win32-OpenSSH/issues/2183