I've got an error when I was trying to compile bgfx in Windows. This is the following error:
C:\Users\rauls\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\172.3544.40\bin\cmake\bin\cmake.exe --build C:\Users\rauls\CLionProjects\Litecraft\cmake-build-debug --target litecraft -- -j 2
[ 6%] Built target pvrtc
[ 20%] Built target bx
[ 26%] Built target squish
[ 33%] Built target edtaa3
[ 33%] Built target etc1
[ 33%] Built target Boost_system
[ 40%] Built target iqa
[ 53%] Built target nvtt
[ 53%] Built target etc2
[ 53%] Built target ib-compress
[ 53%] Built target ocornut-imgui
[ 53%] Built target bimg
[ 60%] Built target Boost_filesystem
[ 60%] Building CXX object bgfx/CMakeFiles/bgfx.dir/bgfx/src/renderer_d3d11.cpp.obj
[ 60%] Building CXX object bgfx/CMakeFiles/bgfx.dir/bgfx/src/renderer_d3d12.cpp.obj
In file included from C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.h:15:0,
from C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp:9:
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:946:56: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_QUEUE_FLAGS );
^
In file included from C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.h:15:0,
from C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp:9:
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:1598:57: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_PIPELINE_STATE_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:1653:65: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_MIN_PRECISION_SUPPORT );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:1715:52: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT1 );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:1733:52: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT2 );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:1741:68: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:1876:47: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_HEAP_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:1916:51: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:2016:55: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_MAPPING_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:2026:52: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_COPY_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:2050:52: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_STATES );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:2087:59: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_BARRIER_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:2161:53: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_SRV_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:2414:53: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_UAV_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:2608:46: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_DSV_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:2644:48: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_CLEAR_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:2653:48: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_FENCE_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:2671:58: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_HEAP_FLAGS );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:2763:57: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_SIGNATURE_FLAGS );
^
In file included from C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12.h:6189:0,
from C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.h:15,
from C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp:9:
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h:187:50: error: expected constructor, destructor, or type conversion before ';' token
DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEBUG_FEATURE );
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h:200:1: error: expected constructor, destructor, or type conversion before 'extern'
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_c_ifspec;
^~~~~~
In file included from C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.h:37:0,
from C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp:9:
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3dx12.h: In function 'UINT64 GetRequiredIntermediateSize(ID3D12Resource*, UINT, UINT)':
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3dx12.h:1359:58: error: expected primary-expression before ')' token
pDestinationResource->GetDevice(__uuidof(ID3D12Device), reinterpret_cast<void**>(&pDevice));
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3dx12.h:1359:58: error: '__uuidof' was not declared in this scope
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3dx12.h: In function 'UINT64 UpdateSubresources(ID3D12GraphicsCommandList*, ID3D12Resource*, ID3D12Resource*, UINT64, UINT, UINT, D3D12_SUBRESOURCE_DATA*)':
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3dx12.h:1453:58: error: expected primary-expression before ')' token
pDestinationResource->GetDevice(__uuidof(ID3D12Device), reinterpret_cast<void**>(&pDevice));
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3dx12.h:1453:58: error: '__uuidof' was not declared in this scope
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3dx12.h: In function 'UINT64 UpdateSubresources(ID3D12GraphicsCommandList*, ID3D12Resource*, ID3D12Resource*, UINT64, UINT, UINT, D3D12_SUBRESOURCE_DATA*)':
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3dx12.h:1481:54: error: there are no arguments to '__uuidof' that depend on a template parameter, so a declaration of '__uuidof' must be available [-fpermissive]
pDestinationResource->GetDevice(__uuidof(*pDevice), reinterpret_cast<void**>(&pDevice));
^
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3dx12.h:1481:54: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d11.h:14382:0,
from C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d11_1.h:127,
from C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d11_2.h:66,
from C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d11_3.h:115,
from C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d11.h:23,
from C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d11.cpp:9:
C:/Users/rauls/CLionProjects/Litecraft/bgfx/bgfx/3rdparty/dxsdk/include/d3d11sdklayers.h:129:1: error: expected constructor, destructor, or type conversion before 'extern'
extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0000_v0_0_c_ifspec;
^~~~~~
C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp: In member function 'void bgfx::d3d12::TextureD3D12::create(const bgfx::Memory*, uint32_t, uint8_t)':
C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp:4213:27: error: invalid conversion from 'int' to 'D3D12_RESOURCE_FLAGS' [-fpermissive]
resourceDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp:4214:27: error: invalid conversion from 'int' to 'D3D12_RESOURCE_STATES' [-fpermissive]
state |= D3D12_RESOURCE_STATE_DEPTH_WRITE;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp:4215:28: error: invalid conversion from 'int' to 'D3D12_RESOURCE_STATES' [-fpermissive]
state &= ~D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp:4231:27: error: invalid conversion from 'int' to 'D3D12_RESOURCE_FLAGS' [-fpermissive]
resourceDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp:4236:27: error: invalid conversion from 'int' to 'D3D12_RESOURCE_FLAGS' [-fpermissive]
resourceDesc.Flags |= D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp:4237:28: error: invalid conversion from 'int' to 'D3D12_RESOURCE_STATES' [-fpermissive]
state &= ~D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\rauls\CLionProjects\Litecraft\bgfx\bgfx\src\renderer_d3d12.cpp:4242:27: error: invalid conversion from 'int' to 'D3D12_RESOURCE_FLAGS' [-fpermissive]
resourceDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mingw32-make.exe[3]: *** [bgfx/CMakeFiles/bgfx.dir/bgfx/src/renderer_d3d12.cpp.obj] Error 1
bgfx\CMakeFiles\bgfx.dir\build.make:262: recipe for target 'bgfx/CMakeFiles/bgfx.dir/bgfx/src/renderer_d3d12.cpp.obj' failed
mingw32-make.exe[3]: *** Waiting for unfinished jobs....
mingw32-make.exe[3]: *** [bgfx/CMakeFiles/bgfx.dir/bgfx/src/renderer_d3d11.cpp.obj] Error 1
bgfx\CMakeFiles\bgfx.dir\build.make:237: recipe for target 'bgfx/CMakeFiles/bgfx.dir/bgfx/src/renderer_d3d11.cpp.obj' failed
mingw32-make.exe[2]: *** [bgfx/CMakeFiles/bgfx.dir/all] Error 2
CMakeFiles\Makefile2:1073: recipe for target 'bgfx/CMakeFiles/bgfx.dir/all' failed
CMakeFiles\Makefile2:3628: recipe for target 'src/CMakeFiles/litecraft.dir/rule' failed
mingw32-make.exe[1]: *** [src/CMakeFiles/litecraft.dir/rule] Error 2
Makefile:1268: recipe for target 'litecraft' failed
mingw32-make.exe: *** [litecraft] Error 2
I tried also to compile it with the examples, but the same error occur.