DiligentGraphics / DiligentEngine

A modern cross-platform low-level graphics library and rendering framework
http://diligentgraphics.com/diligent-engine/
Apache License 2.0
3.36k stars 317 forks source link

Error building using MinGW-x64 #289

Closed TyrannusX closed 1 week ago

TyrannusX commented 1 week ago

Hello. I'm currently trying to build Diligent using MinGW-x64 (see below for compiler versions)

gcc.exe (GCC) 13.2.0 g++.exe (GCC) 13.2.0

I generated the makefile using CMake, but when running "make" it fails halfway with this error

[ 49%] Linking CXX static library libDiligent-GraphicsTools.a [ 49%] Built target Diligent-GraphicsTools [ 49%] Combining libraries... C:\Apps\w64devkit\bin/ar.exe: *.obj: Invalid argument make[2]: [DiligentCore\CMakeFiles\DiligentCore-static.dir\build.make:98: DiligentCore/libDiligentCore.a] Error 1 make[2]: Deleting file 'DiligentCore/libDiligentCore.a' make[1]: [CMakeFiles\Makefile2:2188: DiligentCore/CMakeFiles/DiligentCore-static.dir/all] Error 2 make: [Makefile:155: all] Error 2

Any ideas?

TheMostDiligent commented 1 week ago

Our build on CI uses gcc 12.2.0 and finishes successfully Which distribution do you use? We test with these

TyrannusX commented 1 week ago

I'm using this one

https://github.com/skeeto/w64devkit

TheMostDiligent commented 1 week ago

Apparently, it does not have the ar utility.

TyrannusX commented 1 week ago

Hmm I ran ar.exe from the provided command line and it seems to work. Would MSYS2 work for building Diligent?

TheMostDiligent commented 1 week ago

You may try. There are too many distributions for us to try them all. Note that MinGW is really not a recommended way to build the engine.

TyrannusX commented 1 week ago

Yes, thank you. I saw in the readme that MinGW was not recommended. I just prefer MinGW over MSVC/Visual Studio for Windows. Looks like using the distribution you recommended fixed my problem though!