RT2
Topic Author
Posts: 4
Joined: 11 Oct 2014, 11:41

Clang-cl build error

22 May 2025, 13:25

Hello,

I'm building NoesisApp for Windows using clang-cl, and everything works well except for a minor issue that's trivial to fix. Here's how to reproduce it:
  • In the NoesisGUI native SDK for Windows (3.2.7), open NoesisApp-vs2022.vcxproj.
  • In the project properties, set the Platform Toolset to LLVM (clang-cl) and Treat Warnings as Errors to No.
  • Build the project. You will encounter the following error:
    expected '(' for function-style cast or type construction (Src\Packages\Render\D3D11RenderDevice\Src\D3D11RenderDevice.cpp, 199)
This is caused by the following line in D3D11RenderDevice.cpp:
viewDesc.Texture2D.MipLevels = unsigned int(-1);
The fix is simply to explicitly use a static cast:
viewDesc.Texture2D.MipLevels = static_cast<unsigned int>(-1);
 
User avatar
jsantos
Site Admin
Posts: 4822
Joined: 20 Jan 2012, 17:18
Contact:

Re: Clang-cl build error

22 May 2025, 15:34

Thanks for reporting! I will fix this
 
User avatar
jsantos
Site Admin
Posts: 4822
Joined: 20 Jan 2012, 17:18
Contact:

Re: Clang-cl build error

27 May 2025, 13:46

Fixed it like this:
        D3D11_SHADER_RESOURCE_VIEW_DESC viewDesc;
        viewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
        viewDesc.Texture2D.MipLevels = (UINT)(-1);
        viewDesc.Texture2D.MostDetailedMip = 0;
 
RT2
Topic Author
Posts: 4
Joined: 11 Oct 2014, 11:41

Re: Clang-cl build error

27 May 2025, 13:49

That also works, thanks for the fix.

Who is online

Users browsing this forum: No registered users and 7 guests