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

fatal error C1083: Cannot open include file: 'windows.h': No such file or directory #139

Open
hacksysteam opened this issue Sep 15, 2024 · 10 comments

Comments

@hacksysteam
Copy link
Contributor

hacksysteam commented Sep 15, 2024

When using the latest WDK, there are 2 (10.x) directories. The fixincludes or lowercase script does not create appropriate changes.

- WDK_INSTALLER_URL: "https://go.microsoft.com/fwlink/?linkid=2249371"
+ WDK_INSTALLER_URL: "https://go.microsoft.com/fwlink/?linkid=2272234"
#13 37.04 Merging WDK 'Build' and 'build' directories into version 10.0.26100.0
#13 37.04 Moving WDK.Legacy.props into version 10.0.26100.0
#13 37.04 Moving WDK.props into version 10.0.26100.0
#13 37.60 Using SDK version 10.0.26100.0
#13 38.46 Using MSVC version 14.41.34120
#13 42.17 Build msvctricks ...
#13 42.25 Microsoft (R) C/C++ Optimizing Compiler Version 19.41.34120 for x64
#13 42.25 Copyright (C) Microsoft Corporation.  All rights reserved.
#13 42.25 
#13 42.25 msvctricks.cpp
#13 42.25 z:/tmp/msvc-wine/msvctricks.cpp(17): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

Failing action: https://github.com/hacksysteam/msvc-wine/actions/runs/10872722342/job/30168067508
Diff: hacksysteam@9978f9c?diff=split&w=0

@huangqinjin
Copy link
Contributor

The latest WDK requires Windows SDK 10.0.26100, you may try add --sdk-version 10.0.26100.

@hacksysteam
Copy link
Contributor Author

But windows.h is not there in this version and the issue only happens when we install wdk, without wdk it works

@huangqinjin
Copy link
Contributor

By default, Windows SDK 10.0.22621 is installed. If you install WDK also, directory 10.0.26100.0 is also created but only contains WDK not SDK. And wrappers always choose the maximum version.

@hacksysteam
Copy link
Contributor Author

Yes, that's the issue. Any idea how to fix it?

@huangqinjin
Copy link
Contributor

WDK and SDK version must match, so --sdk-version should be used. A better solution IMO is to use nupkg (#113 (comment)), so that we can specify the WDK version to download .

@hacksysteam
Copy link
Contributor Author

Ah! Makes sense now. But one more thing, even if I use the older wdk link which is there in the workflow file, I still get the same issue. But it works on Ubuntu image on github actions. I'm using a Debian container and get same missing Windows.h something weird is happening

@hacksysteam
Copy link
Contributor Author

hacksysteam commented Sep 24, 2024

Hi @huangqinjin after merging your pull request, the issue persists.

#14 32.99 Unpacking WDK VS extension WDK.vsix
#14 33.02 Merging WDK 'Build' and 'build' directories into version 10.0.22621.0
#14 33.02 Moving WDK.Legacy.props into version 10.0.22621.0
#14 33.02 Moving WDK.props into version 10.0.22621.0
#14 33.64 Using SDK version 10.0.22621.0
#14 34.48 Using MSVC version 14.41.34120
#14 38.65 Build msvctricks ...
#14 38.74 msvctricks.cpp
#14 38.74 z:/tmp/msvc-wine/msvctricks.cpp(17): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

this time it could select the correct SDK version as I specified in the command line.

python3 vsdownload.py --accept-license \
        --dest ${MSVC_HOME} \
        --host-arch x64 \
        --architecture x86 x64 \
        --sdk-version 10.0.22621.0 \
        --cache /tmp/msvc \
        --with-wdk-installers /tmp/wdk/Installers; \
bash install.sh ${MSVC_HOME};

@hacksysteam
Copy link
Contributor Author

So instead of specifying the --sdk-version if we specify the --msvc-version then it works with and without wdk.

Updated command:

python3 vsdownload.py --accept-license \
        --dest ${MSVC_HOME} \
        --host-arch x64 \
        --architecture x86 x64 \
        --msvc-version 17.11 \
        --cache /tmp/msvc \
        --with-wdk-installers /tmp/wdk/Installers; \
bash install.sh ${MSVC_HOME};

@hacksysteam
Copy link
Contributor Author

New issue, there is no msbuild.exe in the MSVC_HOME directory

@hacksysteam
Copy link
Contributor Author

hacksysteam commented Sep 25, 2024

Update: the issue is resolved, seems there was an issue with the downloaded files.

WDK_INSTALLER_URL="https://go.microsoft.com/fwlink/?linkid=2249371"
python3 ./vsdownload.py --accept-license \
        --dest ${MSVC_HOME} \
        --host-arch x64 \
        --architecture x86 x64 \
        --with-wdk-installers /tmp/wdk/Installers;

All tests passed as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants