DiligentGraphics/DiligentCore

can't build diligent-core with mingw on windows

AndreyMlashkin opened this issue · 2 comments

os=Windows
arch=x86_64
build_type=Release
compiler=gcc (MinGW installed via choco)
compiler.exception=seh
compiler.libcxx=libstdc++11
compiler.threads=posix
compiler.version=12.2.0
cppstd=17
CC="C:/ProgramData/chocolatey/bin/gcc.exe"
CXX="C:/ProgramData/chocolatey/bin/g++.exe"

Build error:

C:\Users\Administrator\sources\DiligentEngine\DiligentCore\Graphics\GraphicsEngineOpenGL\src\EngineFactoryOpenGL.cpp: In function 'void Diligent::SetDefaultGraphicsAdapterInfo(GraphicsAdapterInfo&)':
C:\Users\Administrator\sources\DiligentEngine\DiligentCore\Graphics\GraphicsEngineOpenGL\src\EngineFactoryOpenGL.cpp:112:20: error: no match for 'operator=' (operand types are 'Diligent::GraphicsAdapterInfo' and '<brace-enclosed initializer list>')
  112 |     AdapterInfo = {};
      |                    ^
In file included from C:/Users/Administrator/sources/DiligentEngine/DiligentCore/Graphics/GraphicsEngine/interface/EngineFactory.h:34,
                 from C:/Users/Administrator/sources/DiligentEngine/DiligentCore/Graphics/GraphicsEngine/interface/RenderDevice.h:34,
                 from C:/Users/Administrator/sources/DiligentEngine/DiligentCore/Graphics/GraphicsEngineOpenGL/include/pch.h:125,
                 from C:\Users\Administrator\sources\DiligentEngine\DiligentCore\Graphics\GraphicsEngineOpenGL\src\EngineFactoryOpenGL.cpp:31:
C:/Users/Administrator/sources/DiligentEngine/DiligentCore/Graphics/GraphicsEngine/interface/GraphicsTypes.h:2305:8: note: candidate: 'constexpr Diligent::GraphicsAdapterInfo& Diligent::GraphicsAdapterInfo::operator=(const Diligent::GraphicsAdapterInfo&)'
 2305 | struct GraphicsAdapterInfo

It does not work on current master: 88c22241446fabcac5b557b093e4ac205cd1bbbe

to reproduce call:
cmake -S . -B ./build/MinGW -D CMAKE_BUILD_TYPE=Release -G "MinGW Makefiles"
cmake --build .\build\MinGW\

88c22241446fabcac5b557b093e4ac205cd1bbbe is not DiligentCore's commit, it is DiligentEngine's commit (DiligentGraphics/DiligentEngine@88c2224).
The code snippet that your showed is out-of-date. This issue is fixed in the real current master.

@AndreyMlashkin feel free to reopen if you still see the issue after getting the latest version.
Here is also the latest MinGW build on CI, which succeeded.