microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.85k stars 6.31k forks source link

[libusb] build failure on Windows - <assert.h> not found #39414

Open VioletGiraffe opened 3 months ago

VioletGiraffe commented 3 months ago

Operating system

Windows

Compiler

MSVC

Steps to reproduce the behavior

vcpkg install --triplet=x64-windows-static-md --x-install-root=3rdparty_vcpkg

Failure logs

vcpkg.log build-x64-windows-static-md-rel-out.log

Additional context

I have the following vcpkg.json:

{
  "dependencies": [
    { "name": "libusb", "platform": "windows" }
  ]
}

And I build with this command: vcpkg install --triplet=x64-windows-static-md --x-install-root=3rdparty_vcpkg

CMake configure runs fine, the build starts, and cl.exe complains that is not found. All the relevant logs attached. There is no out-err.log file (there is but it's 0 size).

The same works on 2 other computers, only fails on this one. At first I was sure it's a problem with my Visual Studio installation and I spent hours reinstalling everything. Didn't help. hen I started checking, and realized that other C and C++ libraries compile just fine, and they also include . For example, I checked sqlite3. Also checked raylib (a large C library), exiv2 (a rather large C++ library). I couldn't find any other port that fails in this way, so now reporting this against the libusb port seems justified. But you will have a hard time reproducing the failure as I have no idea what triggers it.

VioletGiraffe commented 2 months ago

I managed to fix it by installing the latest Windows 11 SDK, but that still doesn't explain how other C and C++ ports managed to compile. All the necessary files were present, it was only a problem with includepath not being set to what it should be.