debugir icon indicating copy to clipboard operation
debugir copied to clipboard

Failing to Build on Windows: /Werror

Open Remodor opened this issue 1 year ago • 4 comments

I am trying to build on Windows and get an error:

cl : command line error D8021: invalid numeric argument '/Werror' [D:\XXX\Documents\debugir\build\debugir.vcxproj]

When removing /Werror from the file, I get the same for -Wextra, -Wno-unknown-pragmas -Wno-unused-parameter. After removing all of them, it still fails to build.

Output of running cmake -DCMAKE_BUILD_TYPE=Release ../:

-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.29.30143.0
-- The CXX compiler identification is MSVC 19.29.30143.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- We are on a Windows system
-- Build type: Release
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- Found LLVM 18.1.2
-- Using LLVMConfig.cmake in: D:/XXX/Documents/Programming/LLVM/clang+llvm-18.1.2-x86_64-pc-windows-msvc/lib/cmake/llvm
-- LLVM does not have RTTI enabled. Building with -fno-rtti
-- Configuring done (3.9s)
-- Generating done (0.1s)
-- Build files have been written to: D:/XXX/Documents/debugir/build

When building anyway, after many warnings it fails with:

LINK : fatal error LNK1104: cannot open file 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\DIA SDK\
lib\amd64\diaguids.lib' [D:\XXX\Documents\debugir\build\debugir.vcxproj]

Thanks for your time and help!

Update

I have successfully build it using WSL(Ubuntu). It was necessary to install LLVM 18 (Clang), build-essential, libedit-dev, libzstd-dev, zlib1g-dev, libcurl4-openssl-dev.

Remodor avatar Sep 03 '24 19:09 Remodor

@Remodor Thank you for reporting the Issue. Unfortunately I do not have access to a windows machine to repro and fix this :-(

vaivaswatha avatar Sep 04 '24 15:09 vaivaswatha

I understand, thx for your effort! I will try to build it using WSL.

Is the generated debug file independent of the operating system? I.e. would it make a difference if I created the file on Windows or Linux?

Remodor avatar Sep 11 '24 16:09 Remodor

Is the generated debug file independent of the operating system?

More or less. I guess there could be a target triple that has some OS info, but that shouldn't matter much in this case.

I.e. would it make a difference if I created the file on Windows or Linux?

It shouldn't, but I can't say for sure as I haven't tried it on anything but Linux

vaivaswatha avatar Sep 11 '24 16:09 vaivaswatha

Thanks for the quick reply. I will try and post an update 👍

Remodor avatar Sep 11 '24 16:09 Remodor