premake-core icon indicating copy to clipboard operation
premake-core copied to clipboard

Mingw fails building from Makefile

Open nezvers opened this issue 4 years ago • 8 comments

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!

nezvers avatar Aug 06 '21 13:08 nezvers

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?

starkos avatar Aug 10 '21 10:08 starkos

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.

nezvers avatar Aug 12 '21 08:08 nezvers

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 avatar Aug 12 '21 11:08 nickclark2016

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

nickclark2016 avatar Nov 07 '21 04:11 nickclark2016

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

Biswa96 avatar Jan 08 '22 07:01 Biswa96

@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.

ghost avatar Apr 29 '22 16:04 ghost

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

Biswa96 avatar May 02 '22 06:05 Biswa96

@nezvers Was this fixed for you?

nickclark2016 avatar May 17 '22 04:05 nickclark2016