karl-zylinski / odin-raylib-hot-reload-game-template

An Odin + Raylib game template with Hot Reloading pre-setup
MIT License
150 stars 18 forks source link

qprocess can't be found while running build_hot_reload.bat #10

Closed iAndyHD3 closed 2 months ago

iAndyHD3 commented 2 months ago

As the microsoft qprocess documentation page states, qprocess is only available in windows server

Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

I'm running Windows 11, and as such, qprocess can't be found when running build_hot_reload.bat

I fixed this by applying this solution as follows, feel free to copy it, adapt it or find some other fix.

@echo off
SETLOCAL EnableExtensions

rem Build game.dll
odin build . -show-timings -use-separate-modules -define:RAYLIB_SHARED=true -build-mode:dll -out:game.dll -strict-style -vet-unused -vet-using-stmt -vet-using-param -vet-style -vet-semicolon -debug
IF %ERRORLEVEL% NEQ 0 exit /b 1

rem If game.exe already running: Then only compile game.dll and exit cleanly
set EXE=game.exe

FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto ProcessFound

goto ProcessNotFound

:ProcessFound
exit /b 1

:ProcessNotFound

rem build game.exe
odin build main_hot_reload -use-separate-modules -out:game.exe -strict-style -vet-using-stmt -vet-using-param -vet-style -vet-semicolon -debug
IF %ERRORLEVEL% NEQ 0 exit /b 1

rem copy raylib.dll from odin folder to here
if not exist "raylib.dll" (
    echo "Please copy raylib.dll from <your_odin_compiler>/vendor/raylib/windows/raylib.dll to the same directory as game.exe"
    exit /b 1
)

exit /b 0
karl-zylinski commented 2 months ago

Hmm, strange! I am on win10 and it works.

karl-zylinski commented 2 months ago

@iAndyHD3 is it perhaps something with that I run Win10 Pro and you have some "home edition" or something of Win11?

karl-zylinski commented 2 months ago

Fixed in https://github.com/karl-zylinski/odin-raylib-hot-reload-game-template/commit/22bdb1ed96eeeccb8ef02846f13da15430bb6ed2

Thanks for letting me know.