blackmagic-debug/bmputil

Windows build of bmputil fails - no `cl.exe`

Closed this issue · 6 comments

Doesn't surprise me because I've not installed a C compiler but the instructions don't tell me that I need to, or which compiler they prefer. I'm going to guess at a Windows compiler (not gcc) since its "cl.exe".

As an aside, bmputil seems to require a very old instance of the Windows DDK - time for an update for Windows 10/11?

Tried using both the x86 and x64 native VS 2019 systems and neither will build this code. For example using the x846 compiler...

C:\Users\PDS\git>"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Z7" "-Brepro" "-I" "C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi" "-I" "C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\msvc" "-W4" "/Oi" "/Zc:wchar_t" "/TC" "-D_CRT_SECURE_NO_WARNINGS" "-D_WINDLL" "-D_UNICODE" "-DUNICODE" "-DWIN64" "-FoC:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\6a00f5b16ca3e09e-libwdi.o" "-c" "C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi\\libwdi.c"
libwdi.c
C:\Users\PDS\AppData\Local\Temp\cargo-installQdOXsx\release\build\libwdi-sys-b04e55ea09ed1962\out\libwdi\libwdi\libwdi_i.h(39) : warning : library is compiled as 64 bit - disabling 32 bit support
C:\Users\PDS\AppData\Local\Temp\cargo-installQdOXsx\release\build\libwdi-sys-b04e55ea09ed1962\out\libwdi\libwdi\libwdi_i.h(47) : warning : this library will be INCOMPATIBLE with 32 bit platforms
C:\Users\PDS\AppData\Local\Temp\cargo-installQdOXsx\release\build\libwdi-sys-b04e55ea09ed1962\out\libwdi\libwdi\msapi_utf8.h(758): warning C4204: nonstandard extension used: non-constant aggregate initializer
C:\Users\PDS\AppData\Local\Temp\cargo-installQdOXsx\release\build\libwdi-sys-b04e55ea09ed1962\out\libwdi\libwdi\stdfn.h(61): warning C4245: 'initializing': conversion from 'int' to 'DWORD', signed/unsigned mismatch
C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi\\libwdi.c(1148): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'const unsigned char *const '
C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi\\libwdi.c(1216): error C2065: 'SYSTEM_CODEINTEGRITY_INFORMATION': undeclared identifier
C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi\\libwdi.c(1216): error C2146: syntax error: missing ';' before identifier 'sci'
C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi\\libwdi.c(1216): error C2065: 'sci': undeclared identifier
C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi\\libwdi.c(1216): error C2059: syntax error: '{'
C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi\\libwdi.c(1505): error C2065: 'sci': undeclared identifier
C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi\\libwdi.c(1505): error C2224: left of '.Length' must have struct/union type
C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi\\libwdi.c(1506): error C2065: 'sci': undeclared identifier
C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi\\libwdi.c(1507): error C2065: 'sci': undeclared identifier
C:\\Users\\PDS\\AppData\\Local\\Temp\\cargo-installQdOXsx\\release\\build\\libwdi-sys-b04e55ea09ed1962\\out\\libwdi\\libwdi\\libwdi.c(1507): error C2224: left of '.CodeIntegrityOptions' must have struct/union type

FYI, building using the cargo instructions i.e. running cargo install --git https://github.com/blackmagic-debug/bmputil

Hi there,
How did you install Rust? If you use the installer they provide (Linked in the README) it will prompt you to install Visual Studio and the required C toolchain. The default options in the rustup installer will install the toolchain for you.
It seems to me that you've got a broken or misconfigured rust install, as an error about cl.exe is an issue with your system lacking the prerequisites for compiling Rust projects.
Additionally, the cargo install --git command you are using does behave slightly differently to cargo install --path . under the hood. I'd suggest using the recommended instructions first, to make sure that it's not an issue with your modified compile method.

Going to say that this was fully resolved by #20 on the black-magic-org repo. The original issue appears to be that the black-magic-org "Upgrade" page provided different instructions, which led users to not check the source they were running cargo install --git on, and so they were skipping the windows-specific setup requirements. It has now been fixed to direct users to the readme on this repo.

The original instructions on the black-magic-org page should have been enough, but reducing duplication of information is helpful anyway, and will hopefully guide less experienced users/developers towards the correct setup.
@dragonmux this should be good to be closed now

esden commented

Thanks @FoxieDev. That should indeed take care of it. I am closing this issue for now. If the OG thinks the issue persists please feel free to reopen this issue or open a new one with detailed error description.

Thanks for looking at this. Sorry for not responding sooner. The time I have to work on "fun" projects is very variable (families - huh!).