Raylib mingw compilation problem

Hi
I hope that I can find some answers , thank you very much
how to compile Raylib source with mingw for windows x86 and x64?
how to compile Raylib game with mingw for windows and other platforms?
when compile a game with mingw32-make does this include raylib dll inside the builded exe ? I mean is all raylib .h .c files compiled inside the game ?is it no need to copy raylib dll with game.exe ?

I compiled and get this error:
> C:\raylib\raylib\src>mingw32-make PLATFORM=PLATFORM_DESKTOP
> ar rcs ../release/libs/win32/mingw32/libraylib.a core.o shapes.o textures.o text.o models.o utils.o rglfw.o audio.o stb_vorbis.o mini_al.o
> ar: ../release/libs/win32/mingw32/libraylib.a: No such file or directory
> Makefile:518: recipe for target 'raylib' failed
> mingw32-make: *** [raylib] Error 1

Thank You Very Much

Comments

  • when compiled with : C:\raylib\raylib\src>mingw32-make PLATFORM=PLATFORM_DESKTOP -B
    I got this :
    gcc -c models.c -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing -Werror=implicit-function-declaration -I. -Iexternal -Iexternal/glfw/include -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
    models.c: In function 'MeshBinormals':
    models.c:2209:17: warning: unused variable 'binormal' [-Wunused-variable]
    Vector3 binormal = Vector3Multiply(Vector3CrossProduct(normal, tangent), tangentW);
    ^~~~~~~~
    gcc -c utils.c -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing -Werror=implicit-function-declaration -I. -Iexternal -Iexternal/glfw/include -DPLATFORM_DESKTOP
    gcc -c rglfw.c -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing -Werror=implicit-function-declaration -I. -Iexternal -Iexternal/glfw/include -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
    In file included from external/glfw/src/internal.h:186:0,
    from external/glfw/src/context.c:28,
    from rglfw.c:52:
    external/glfw/src/win32_platform.h:66:20: fatal error: dinput.h: No such file or directory
    # include dinput.h

    compilation terminated.
    Makefile:531: recipe for target 'rglfw.o' failed
    mingw32-make: *** [rglfw.o] Error 1
  • That's related to mingw32 version, try updating to mingw32-w64
  • Thank you very much for replay
    even in notepad++ when selecting raylib_makefile and try to build raylib.h I got this :

    gcc -c external/mini_al.c -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing -Werror=implicit-function-declaration -I. -Iexternal -Iexternal/glfw/include -DPLATFORM_DESKTOP
    ar rcs ../release/libs/win32/mingw32/libraylib.a core.o shapes.o textures.o text.o models.o utils.o rglfw.o audio.o stb_vorbis.o mini_al.o
    ar: ../release/libs/win32/mingw32/libraylib.a: No such file or directory
    mingw32-make: *** [Makefile:518: raylib] Error 1

    raylib_source_compile shows no error but there is no compiled files in src
  • I instaled mingw32-w64 and changed the environment variable and get the same error

    C:\raylib\raylib\src>mingw32-make PLATFORM=PLATFORM_DESKTOP
    ar rcs ../release/libs/win32/mingw32/libraylib.a core.o shapes.o textures.o text.o models.o utils.o rglfw.o audio.o stb_vorbis.o mini_al.o
    ar: ../release/libs/win32/mingw32/libraylib.a: No such file or directory
    mingw32-make: *** [Makefile:518: raylib] Error 1
  • oh, I see, just create the folder C:/raylib/raylib/release/libs/win32/mingw32
  • Thank you for replay
    it produce libraylib.a not a dll
    trying to compile examples got:
    C:\raylib\raylib\examples\models>mingw32-make PLATFORM=PLATFORM_DESKTOP
    mingw32-make: *** No targets specified and no makefile found. Stop.
  • Ok , this C:\raylib\raylib\examples>mingw32-make PLATFORM=PLATFORM_DESKTOP
    compiled all examples at once.

    makefile is needed to compile one example, how to get this makefile ?
  • Use: C:\raylib\raylib\examples>mingw32-make PLATFORM=PLATFORM_DESKTOP core/core_basic_window
  • Thanks for reply
    wow the line worked, thak you
    before that I used an edited makefile from templates
    still dont know how to produce x86 & x64 dll from mingw
  • compiling to other platforms :
    1-WEB
    C:\raylib\raylib\templates\standard_game>mingw32-make PLATFORM=PLATFORM_WEB
    mingw32-make standard_game
    mingw32-make[1]: Entering directory 'C:/raylib/raylib/templates/standard_game'
    emcc -c standard_game.c -o standard_game.o -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources --shell-file ../..\templates\web_shell\shell.html -I. -I../../release/include -I../../src -I../../src/external -DPLATFORM_WEB
    process_begin: CreateProcess(NULL, emcc -c standard_game.c -o standard_game.o -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources --shell-file ../..\templates\web_shell\shell.html -I. -I../../release/include -I../../src -I../../src/external -DPLATFORM_WEB, ...) failed.
    make (e=2): The system cannot find the file specified.
    mingw32-make[1]: *** [Makefile:307: standard_game.o] Error 2
    mingw32-make[1]: Leaving directory 'C:/raylib/raylib/templates/standard_game'
    mingw32-make: *** [Makefile:298: all] Error 2

    -------------------------------------------------------------------
    2-RPI
    C:\raylib\raylib\templates\standard_game>mingw32-make PLATFORM=PLATFORM_RPI
    process_begin: CreateProcess(NULL, uname, ...) failed.
    mingw32-make: Makefile:80: pipe: No error
    mingw32-make standard_game
    mingw32-make[1]: Entering directory 'C:/raylib/raylib/templates/standard_game'
    process_begin: CreateProcess(NULL, uname, ...) failed.
    mingw32-make[1]: Makefile:80: pipe: No error
    gcc -c standard_game.c -o standard_game.o -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -std=gnu99 -I. -I../../release/include -I../../src -I../../src/external -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -DPLATFORM_RPI
    gcc -o standard_game standard_game.o screens/screen_logo.o screens/screen_title.o screens/screen_options.o screens/screen_gameplay.o screens/screen_ending.o -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -std=gnu99 -I. -I../../release/include -I../../src -I../../src/external -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -L. -L../../release/libs/rpi -L../../src -L/opt/vc/lib -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl -DPLATFORM_RPI
    C:/raylib/mingw/bin/../lib/gcc/i686-w64-mingw32/7.2.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lbrcmGLESv2
    C:/raylib/mingw/bin/../lib/gcc/i686-w64-mingw32/7.2.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lbrcmEGL
    C:/raylib/mingw/bin/../lib/gcc/i686-w64-mingw32/7.2.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lrt
    C:/raylib/mingw/bin/../lib/gcc/i686-w64-mingw32/7.2.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lbcm_host
    C:/raylib/mingw/bin/../lib/gcc/i686-w64-mingw32/7.2.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -ldl
    collect2.exe: error: ld returned 1 exit status
    mingw32-make[1]: *** [Makefile:302: standard_game] Error 1
    mingw32-make[1]: Leaving directory 'C:/raylib/raylib/templates/standard_game'
    mingw32-make: *** [Makefile:298: all] Error 2

    ------------------------------------------------------------------
    3-UWP
    C:\raylib\raylib\templates\standard_game>mingw32-make PLATFORM=PLATFORM_UWP standard_game
    gcc -o standard_game standard_game.o screens/screen_logo.o screens/screen_title.o screens/screen_options.o screens/screen_gameplay.o screens/screen_ending.o -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -I. -I../../release/include -I../../src -I../../src/external -L. -L../../release/libs -L../../src -DPLATFORM_UWP
    standard_game.o:standard_game.c:(.text+0x26): undefined reference to `InitWindow'
    standard_game.o:standard_game.c:(.text+0x41): undefined reference to `SetTargetFPS'
    standard_game.o:standard_game.c:(.text+0x59): undefined reference to `BeginDrawing'
    standard_game.o:standard_game.c:(.text+0x65): undefined reference to `ClearBackground'
    standard_game.o:standard_game.c:(.text+0x167): undefined reference to `EndDrawing'
    standard_game.o:standard_game.c:(.text+0x16c): undefined reference to `WindowShouldClose'
    standard_game.o:standard_game.c:(.text+0x1aa): undefined reference to `CloseWindow'
    screens/screen_logo.o:screen_logo.c:(.text+0x5e): undefined reference to `DrawText'
    screens/screen_logo.o:screen_logo.c:(.text+0x8a): undefined reference to `DrawText'
    screens/screen_title.o:screen_title.c:(.text+0x16): undefined reference to `IsKeyPressed'
    screens/screen_title.o:screen_title.c:(.text+0x34): undefined reference to `IsGestureDetected'
    screens/screen_title.o:screen_title.c:(.text+0x43): undefined reference to `GetScreenHeight'
    screens/screen_title.o:screen_title.c:(.text+0x4a): undefined reference to `GetScreenWidth'
    screens/screen_title.o:screen_title.c:(.text+0x6e): undefined reference to `DrawRectangle'
    screens/screen_title.o:screen_title.c:(.text+0x9a): undefined reference to `DrawText'
    screens/screen_title.o:screen_title.c:(.text+0xc6): undefined reference to `DrawText'
    screens/screen_gameplay.o:screen_gameplay.c:(.text+0x16): undefined reference to `IsKeyPressed'
    screens/screen_gameplay.o:screen_gameplay.c:(.text+0x34): undefined reference to `IsGestureDetected'
    screens/screen_gameplay.o:screen_gameplay.c:(.text+0x43): undefined reference to `GetScreenHeight'
    screens/screen_gameplay.o:screen_gameplay.c:(.text+0x4a): undefined reference to `GetScreenWidth'
    screens/screen_gameplay.o:screen_gameplay.c:(.text+0x6e): undefined reference to `DrawRectangle'
    screens/screen_gameplay.o:screen_gameplay.c:(.text+0x9a): undefined reference to `DrawText'
    screens/screen_gameplay.o:screen_gameplay.c:(.text+0xc6): undefined reference to `DrawText'
    screens/screen_ending.o:screen_ending.c:(.text+0x16): undefined reference to `IsKeyPressed'
    screens/screen_ending.o:screen_ending.c:(.text+0x34): undefined reference to `IsGestureDetected'
    screens/screen_ending.o:screen_ending.c:(.text+0x43): undefined reference to `GetScreenHeight'
    screens/screen_ending.o:screen_ending.c:(.text+0x4a): undefined reference to `GetScreenWidth'
    screens/screen_ending.o:screen_ending.c:(.text+0x6e): undefined reference to `DrawRectangle'
    screens/screen_ending.o:screen_ending.c:(.text+0x9a): undefined reference to `DrawText'
    screens/screen_ending.o:screen_ending.c:(.text+0xc6): undefined reference to `DrawText'
    collect2.exe: error: ld returned 1 exit status
    mingw32-make: *** [Makefile:302: standard_game] Error 1
Sign In or Register to comment.