premake / premake-core

Premake
https://premake.github.io/
BSD 3-Clause "New" or "Revised" License
3.23k stars 621 forks source link

Mingw fails building from Makefile #1686

Open nezvers opened 3 years ago

nezvers commented 3 years ago

What seems to be the problem? It generates flawlessly the .sln project, but makefile gets a build fail. gcc version 8.1.0 (x86_64-win32-sjlj-rev0, Built by MinGW-W64 project and several others I tried.

Error on the first object (in reproduction are links to projects):

core.c
process_begin: CreateProcess(NULL, D:\Dev\Compiler\mingw64\bin -MMD -MP -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -I../raylib/src -I../raylib/src/external/glfw/include -m64 -g -o obj/x64/Debug/raylib/core.o -MF obj/x64/Debug/raylib/core.d -c ../raylib/src/core.c, ...) failed.

I'm not that well knowing in Makefiles, looking at rayilb.make in the build directory is over my knowledge.

What did you expect to happen? Calling mingw32-make would compile using generated Makefile.

What have you tried so far? I tried different MinGW versions and they didn't work either.

How can we reproduce this? Perfect examples RaylibExtras or LunarViewer, both consisting from Raylib and provides premake5 scripts.

What version of Premake are you using? 5.0.0-alpha16

Anything else we should know? Have a good day!

starkos commented 3 years ago

What is the exact error message you're seeing when you try to build? Have you already raised this issue with the maintainers of those projects you mention?

nezvers commented 3 years ago

Full error is this:

"==== Building raylib (debug_x64) ===="
Creating obj/x64/Debug/raylib
core.c
process_begin: CreateProcess(NULL, D:\Dev\Compiler\mingw64\bin -MMD -MP -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -I../raylib/src -I../raylib/src/external/glfw/include -m64 -g -o obj/x64/Debug/raylib/core.o -MF obj/x64/Debug/raylib/core.d -c ../raylib/src/core.c, ...) failed.
make (e=5): Access is denied.
mingw32-make[1]: *** [raylib.make:168: obj/x64/Debug/raylib/core.o] Error 5
mingw32-make: *** [Makefile:40: raylib] Error 2

I already raised the issue on project, but no response.

nickclark2016 commented 3 years ago

To me, this doesn't sound like a Premake issue. Check if you have your makefile open when you're building, or if some antivirus is blocking the make program from running.

https://stackoverflow.com/questions/17153187/access-denied-when-building-a-project

nickclark2016 commented 3 years ago

Just nudging this to see if there's an update regarding my last reply @nezvers

Biswa96 commented 2 years ago

Build failed in mingw x86 with beta version. Here is the output:

  make -C build/bootstrap config=release_x86
  Makefile:34: *** "invalid configuration release_x86".  Stop.

It succeed in alpha release. Here is the commands used https://github.com/Biswa96/MINGW-packages/blob/master/mingw-w64-premake/PKGBUILD

ghost commented 2 years ago

@nezvers On Windows it looks like make don't have the $(CC) variable set. Try to append CC=gcc CXX=g++ to your make call.

@Biswa96 In your case you have just used the wrong configuration. Based on the provided link you should use this: make -f Bootstrap.mak mingw CONFIG=release PLATFORM=x86

For my tests i have used the TDM-GCC distribution, check your %PATH%/$PATH; escpecially on Windows.

Biswa96 commented 2 years ago

My issue was fixed in this commit recently https://github.com/premake/premake-core/commit/0439fc0a66e5ea7aafeadb82630ce3889917cccd

nickclark2016 commented 2 years ago

@nezvers Was this fixed for you?