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

update MSBuild solution to Windows SDK v10.0, add inet_pton define (fixes #5856) #5884

Merged
merged 3 commits into from
May 31, 2023

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented May 11, 2023

Fixes #5856.
Contributes to #5061.

Tonight I tried compiling LightGBM on latest master with MSBUild (using Visual Studio 2019), like this:

MSBuild.exe windows/LightGBM.sln /p:Configuration=DLL /p:Platform=x64 /p:PlatformToolset=v142

That resulted in this error:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\cstddef(12,10): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory (compiling source file ..\src\treelearner\voting_parallel_tree_learner.cpp) [C:\Users\James\repos\LightGBM\windows\LightGBM.vcxproj]

Updating the target Windows SDK version from 8.1 to 10.0 fixed that.

Then I hit the error reported in #5856. I think that happened because when building without CMake, the test introduced in #5159 isn't run, WIN_HAS_INET_PTON isn't defined, and then the implementation in socket_wrapper.hpp conflicts with the one linked in from ws2_32.

This PR proposes always defining that in the MSBuild configuration, since it should be only older releases of MinGW that didn't have a definition for that function.

How I tested this

Ran that command from above on this branch, using Visual Studio 2019 on Windows 10.

Saw that LightGBM compiled successfully.

@jameslamb
Copy link
Collaborator Author

Could I please get a review on this?

@jameslamb jameslamb merged commit d2121aa into master May 31, 2023
@jameslamb jameslamb deleted the update-windows-sdk-version branch May 31, 2023 20:13
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants