DiligentEngine icon indicating copy to clipboard operation
DiligentEngine copied to clipboard

Error building using MinGW-x64

Open TyrannusX opened this issue 3 months ago • 3 comments

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?

TyrannusX avatar May 05 '24 19:05 TyrannusX

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

TheMostDiligent avatar May 05 '24 21:05 TheMostDiligent

I'm using this one

https://github.com/skeeto/w64devkit

TyrannusX avatar May 05 '24 21:05 TyrannusX

Apparently, it does not have the ar utility.

TheMostDiligent avatar May 05 '24 22:05 TheMostDiligent

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

TyrannusX avatar May 05 '24 22:05 TyrannusX

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.

TheMostDiligent avatar May 05 '24 22:05 TheMostDiligent

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!

TyrannusX avatar May 05 '24 22:05 TyrannusX